-
Notifications
You must be signed in to change notification settings - Fork 3
/
sample.py
65 lines (54 loc) · 1.42 KB
/
sample.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import random
import sys
someconst = 3
def inc(x):
return x + 1
def very_understandable_function(x=5):
def get_eleet():
return x
import platform
print 'Hello, %s (%s)' % (platform.platform(), platform.architecture()[0])
r = 10
print 'I like doing stuff with number: %r' % (r % 42)
for i in range(r):
print i + get_eleet(), get_eleet()
if (r % 10):
print 'wUuUUt'
else:
print 'dont care!'
with open('success', 'w') as f:
f.write('yoooo seems to work bra!')
return 0xdeadbeef
#print 'aaa'
class NewStyleClass(object):
#print 'newstyle'
def __init__(self):
super(NewStyleClass, self).__init__()
def doit(self):
print 'i am new'
class NewStyleClassCustomInit(object):
#print 'newstyle'
def __init__(self):
pass
def doit(self):
print 'i am new'
#print 'between'
class OldStyleClass:
#print 'oldstyle'
def doit(self):
print 'i am old'
#print 'bbb'
def generate_random_strings():
"""Generate a random string"""
print 'ucucuga'
charset = map(chr, range(0, 0x100))
print 'ucucuga1'
return ''.join(random.choice(charset) for i in range(random.randint(10, 100)))
if __name__ == '__main__':
very_understandable_function(293)
NewStyleClass().doit()
OldStyleClass().doit()
for i in xrange(10):
print inc(i)
generate_random_strings()
print someconst