Hi Tutors,
#! /usr/bin/env python
print "Hello Tutors"

I have this script saved as hello.py. Why can  I execute it, but not the
compiled version?  or am I doing something wrong? Just curious. Any help
appreciated.
For example :


e...@emad-laptop:~/Desktop/Programming/Haskell$ chmod  +x  hello.py
e...@emad-laptop:~/Desktop/Programming/Haskell$ ./hello.py
Hello Tutors

Now I compile it in Python:
>>> import py_compile
>>> py_compile.compile("hello.py")
>>>
e...@emad-laptop:~/Desktop/Programming/Haskell$ chmod +x hello.pyc

e...@emad-laptop:~/Desktop/Programming/Haskell$ ./hello.pyc
: command not found: �
./hello.pyc: line 2: syntax error near unexpected token `('
./hello.pyc: line 2: `�k...@s    dGHdS(s
                                         Hello
TutorsN((((hello.py<module>s'
e...@emad-laptop:~/Desktop/Programming/Haskell$


-- 
لا أعرف مظلوما تواطأ الناس علي هضمه ولا زهدوا في إنصافه كالحقيقة.....محمد
الغزالي
"No victim has ever been more repressed and alienated than the truth"

Emad Soliman Nawfal
Indiana University, Bloomington
--------------------------------------------------------
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to