Skip to content
Open
Show file tree
Hide file tree
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
50 changes: 50 additions & 0 deletions Test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import os
import anydbm
import pickle


t = [1,2,3]
s = pickle.dumps(t)
t2 = pickle.loads(s)
from pattern.web import *

f = Facebook(licence='CAAEuAis8fUgBAJQKS4ZBRUsxIRlsrW76PcYITJRC5hAoFmhYCyZBWDQc7NLFHtRABcRemTZA6YWByo12xL6ZB8gttBA4lDABIQI8fIcq9Eroaq2VRPoW8ZAPzarU1y7ZBL34eeYYO9TRNcpnMJsVrCN2gZAJICRcnCM5YsDZCXTANkNJSxD0sJw3kuoTGmYourEZD')
me = f.profile()
print me
print t2
print t2 == t
print t2 is t
# cmd = 'python Test.py'
# fp = os.popen(cmd)
# res = fp.read()
print res
# db = anydbm.open('lolcatz.db', 'c')

# db['LOLWUT'] = 'CATZZ!!!'
# print db['LOLWUT']
# db.close
# def test():
# # mystring = raw_input("Hi")
# # ("Input the letters you want to avoid: ")
# fin = open('words.txt' , 'w')
# line1 = "This here's the wattle, \n"
# fin.write(line1)
# line2 = "the emblem of our land.\n"
# camels = 42
# print 'I have spotted %d camels.' % camels
# fin.write(line2)
# fin.close()
# test()


# def walk(dirname):
# for name in os.listdir(dirname):
# path = os.path.join(dirname, name)

# if os.path.isfile(path):
# print path
# else:
# walk(path)


# walk('/home')
2 changes: 2 additions & 0 deletions blah.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
I3
.
2 changes: 2 additions & 0 deletions blah2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
I2
.
2 changes: 2 additions & 0 deletions counter.p
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
I1
.
15 changes: 14 additions & 1 deletion counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,20 @@ def update_counter(file_name, reset=False):
>>> update_counter('blah2.txt')
2
"""
pass
if exists(file_name):
mycounter = load(open(file_name,"rb"))
mycounter += 1
if reset == True:
mycounter = 1
print mycounter
dump( mycounter, open(file_name, "wb"))
else:
mycounter = 1
print mycounter
dump(mycounter, open(file_name, "wb"))


update_counter("blah.txt")

if __name__ == '__main__':
if len(sys.argv) < 2:
Expand Down
Binary file added lolcatz.db
Binary file not shown.
Empty file added mytest.txt
Empty file.
2 changes: 2 additions & 0 deletions words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This here's the wattle,
the emblem of our land.