Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions socode.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,35 @@
import urllib2
import platform

from cStringIO import StringIO


# WARNING: call only if very cool:
def gunn(n=3):
caller = inspect.stack()[1][3]

if caller != "<module>":
sysStdOut = sys.stdout
sys.stdout = StringIO()

shazeline(caller)
out = sys.stdout.getvalue()

sys.stdout.close()
sys.stdout = sysStdOut

print "\n"+out.replace("pretty", "VERY").replace("\n", "!!!\n")

members = inspect.getmembers(sys.modules[__name__])
names = [name for name, obj in members if inspect.isfunction(obj) and name!="lafin"]
random.shuffle(names)
coolGuys = names[:n]

[shazeline(name) for name in coolGuys]

if caller != "gunn" and random.random() > 0.6: gunn(0)
print

def alisnic(number):
print 'fizz' * (number % 3 == 0) + 'buzz' * (number % 5 == 0)

Expand Down Expand Up @@ -615,6 +644,7 @@ def dpayne():
windspy()
samlabs821()
alisnic(random.randint(1, 1024))
gunn()

# as per instructed, please leave this as the final function
lafin()