Executable standalone *.pyc after inserting "#!/usr/bin/python" or other options

schmeii maxischmeii at gmail.com
Fri Jan 15 14:32:30 CET 2010

On Jan 14, 10:55 pm, epsilon <cesm... at gmail.com> wrote:
> All:
> I've been playing with "Lua" and found something really cool that I'm
> unable to do in "Python". With "Lua", a script can be compiled to byte
> code using "luac" and by adding "#!/usr/bin/lua" at the top of the
> binary, the byte code becomes a single file executable. After I found
> this trick, I ran back to "Python" to give it a try.  Well...  it
> didn't work. Is this possible?

You can't add a string on top of a pyc file but you can add one in a
zipped file. For an example, see http://www.noah.org/wiki/Python_zip_exe

More information about the Python-list mailing list