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
""" | |
Startup script for Python interactive mode | |
Add these two lines to .bashrc: | |
PYTHONSTARTUP="$HOME/.pythonrc.py" | |
export PYTHONSTARTUP | |
""" | |
import sys, os, readline, atexit |
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/env python | |
class EightQueens: | |
def __init__(self): | |
self.array = 64 * [-1] | |
def get(self, x, y): | |
return self.array[x + y * 8] |
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
*.pyc |
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
<doc> | |
<person no="1234"> | |
<name>Tomáš</name> | |
<surname>Těžký</surname> | |
</person> | |
<person no="7"> | |
<name>Standa</name> | |
<surname>Blábol</surname> | |
</person> | |
</doc> |
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/env python | |
""" | |
Usage: | |
./rtail.py user@host:path/foo.log bar.log host2:/path/baz.log | |
""" | |
import optparse | |
import os |
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/env python2.6 | |
from lepl import * | |
retezec = String() | String("'") | |
cislo = Digit()[1:] > (lambda chars: int("".join(chars))) | |
slovnik = Delayed() | |
klicSlovniku = retezec | cislo | |
hodnotaSlovniku = retezec | cislo | slovnik |
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
all: a b | |
echo a | |
time ./a | |
time ./a | |
echo b | |
time ./b | |
time ./b | |
a: a.cc | |
g++ -O2 -o a a.cc |
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/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Až moc jednoduchý textový editor. | |
Vlevo je seznam úryvků, dvojklikem na nějaký se úryvek vloží do textu. | |
""" | |
import pygtk | |
pygtk.require("2.0") |
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/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import time | |
from PyQt4 import QtGui, QtCore | |
app = QtGui.QApplication(sys.argv) | |
widget = QtGui.QWidget() |
OlderNewer