how to write or create (when no exist) a file using python and Google AppEngine
- by zjm1126
this is my code:
f = open('text/a.log', 'wb')
f.write('hahaha')
f.close()
and it is not create a new file when not exist
how to do this ,
thanks
updated
class MyThread(threading.Thread):
def run(self):
f = open('a.log', 'w')
f.write('hahaha')
f.close()
error is :
Traceback (most recent call last):
File "D:\Python25\lib\threading.py", line 486, in __bootstrap_inner
self.run()
File "D:\zjm_code\helloworld\views.py", line 15, in run
f = open('a.log', 'w')
File "d:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1188, in __init__
raise IOError('invalid mode: %s' % mode)
IOError: invalid mode: w