Looking for help :
I run abc.py with normal output as I expect, but get error in abc.pyc. Below is what I have done. Would you tell me what I have mistaken ? Thank you very much !!
test_time = open('test.time', 'w')
test_time.write('oh, today is\n')
test_time = open('test.time', 'a')
timing = datetime.date.today()
print timing, type(timing) # 2008-03-09 <type 'datetime.date'>
# convert <type 'datetime.date'> to a string first
# since write() expects a string
# test the file's contents
for line in file('test.time'):
running in termial
2008-03-10 <type 'datetime.date'>
I created abc.pyc
>>> import py_compile
However, when running with abc.pyc
: command not found�
./abc.pyc: line 2: ���Gc@s�ddkZedd�Zeid�ei�edd�Zeii�ZeGe�GHeie: command not found
./abc.pyc: line 3: d�D]: command not found
./abc.pyc: line 4: syntax error near unexpected token `i����Ns'
./abc.pyc: line 4: `Z
So what is wrong ?