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
# Easiest way: | |
# But it is without support for complex number. | |
from math import factorial | |
factorial(6) |
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 -*- | |
# Pascal´s Rectangle | |
start = int(raw_input("Starting number: ")) | |
pascal = [[start]] # at least one item is necessary to be here | |
for cycle in range(int(raw_input("Number of lines: "))-1): | |
line = [] |
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 -*- | |
# Deda vseveda by Visgean Skeloru <visgean (at) gmail.com> | |
# To run this script you have to EAT A CAT and force somebody to COMMIT A SUCIUDE! | |
from random import choice | |
from sys import argv | |
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 pyinotify | |
class notifier(pyinotify.ProcessEvent): | |
def process_IN_ACCESS(self, event): | |
"file was accessed." | |
pass | |
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 -*- | |
# Script for discover where is some module which you want to use with starndart | |
# sys.path | |
import sys, os | |
desiredModule = raw_input("Module name: ") |
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
def pseudoRange(numberOfCycles): | |
i = 0 | |
while i < numberOfCycles: | |
i += 1 | |
yield i | |
for i in pseudoRange(4): | |
print i | |
if i == 2: |
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 -*- | |
# Pythagoras triangle in new version with yield! | |
def giveMeLines(numberOfLines): | |
line = [1] | |
for xexe in xrange(numberOfLines): | |
yield line | |
tempLine = [] # buffer for new elements |
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 -*- | |
def fact(ar): | |
x = 1 | |
while ar > 0: | |
x *= ar | |
ar -= 1 | |
return x |
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 urwid | |
from database import Pathject | |
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
>>> from database import Pathject | |
>>> import urwid | |
>>> paths = map(str, list(Pathject.select())) | |
>>> paths = map(urwid.Text, paths) | |
>>> for path in paths: print path | |
... | |
<Text flow widget "<Pathject 1 path='/' pins='asx' comment=None lastTimeUsed=None timeLimit=1.0>"> | |
<Text flow widget "<Pathject 2 path='/' pins='asx' comment=None lastTimeUsed=None timeLimit=1.0>"> | |
<Text flow widget "<Pathject 3 path='/' pins='asx' comment=None lastTimeUsed=None timeLimit=1.0>"> | |
<Text flow widget "<Pathject 4 path='/' pins='asx' comment=None lastTimeUsed=None timeLimit=1.0>"> |
OlderNewer