This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print sum([1 for number in open('tel.txt').readlines() if number[0:3] == '511']) | |
# 100 loops, best of 3: 1.65 ms per loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [15]: import re | |
In [16]: pattern = re.compile('\(.*\)') | |
In [17]: %timeit pattern.search(string) | |
1000000 loops, best of 3: 1.04 µs per loop | |
In [18]: %timeit '(' in string and ')' in string | |
1000000 loops, best of 3: 260 ns per loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import re | |
import random | |
import urllib2 | |
from urllib import urlencode | |
import irssi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import irssi | |
import feedparser | |
username = 'pagenoare' | |
def nowplaying(data, server, witem): | |
d = feedparser.parse('http://ws.audioscrobbler.com/2.0/user/%s/recenttracks.rss' % username) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import irssi | |
import feedparser | |
username = 'pagenoare' | |
p_title = '' | |
def checker(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from pygnite import * | |
@get('/') | |
def index(request): | |
index.headers = { 'Content-type' : 'text/plain' } | |
# index.status = 200 | |
return 'Hello world' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application: juno | |
version: 1 | |
runtime: python | |
api_version: 1 | |
handlers: | |
- url: .* | |
script: main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: gluon/restricted.py | |
=================================================================== | |
--- gluon/restricted.py (wersja 989) | |
+++ gluon/restricted.py (kopia robocza) | |
@@ -77,7 +77,8 @@ | |
cPickle.dump(d, open(os.path.join(errors_folder, f), 'wb')) | |
- return '%s/%s' % (a, f) | |
+ #return '%s/%s' % (a, f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from pygnite import * | |
@get('/all/#:page?') | |
def index(request): | |
return 'Hello world' | |
#127.0.0.1 - - [05/Jul/2009 21:14:48] "GET /all/aa HTTP/1.1" 404 - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
xkbcomp $HOME/.Xkb $DISPLAY &> /dev/null | |
exec wmii |
OlderNewer