executing .pyc file

Tripp Scott tripp81 at yahoo.com
Mon Dec 3 01:53:41 EST 2001


thanks for the previous reply, now on to the next question :)

has someone written a trick so i can directly execute .pyc in 
unix? my library has an 'if __name__=="main"' section and it 
would be neat if i could just chmod +x the .pyc file and invoke it with:

$ ./file.pyc

instead of

$ python file.pyc

adding a '#!/usr/bin/python' won't cut it. i believe we can do 
something like this--in essence--in perl with the source filter mechanism.

t





More information about the Python-list mailing list