________________________________ From: PythonAB [mailto:pyt...@rgbaz.eu] Sent: Thursday, July 30, 2009 12:18 To: Barak, Ron Cc: 'Dave Angel'; 'python-list@python.org' Subject: Re: Run pyc file without specifying python path ?
Hi Dave, Your solution sort of defeats my intended purpose (sorry for not divulging my 'hidden agenda'). I wanted my application to "hide" the fact that it's a python script, and look as much as possible like it's a compiled program. The reason I don't just give my user a py file, is that I don't want a cleaver user to change the innards of the script. On the other hand, I don't want to make a compiled (freezed?) version of the application, because it'll grow the resulting file significantly, and I don't have the experience to know how it will run on different Linuxes. Bye, Ron. Hey Ron, What i usually do to accomplish this is compile the script to a .pyc just like you did and then call that pyc from another script that's not compiled. so in your case the not compiled script looks like: #!/usr/bin/env python import test_pyc.pyc then run that script... hope this helps... alternatively you might have a look at: http://www.pyinstaller.org/ gr Arno [BR] Thanks for the answer Arno. But, I wonder - How is your suggestion, which to the user would look like: python wrapper.py different (from the user's point-of-view) than the following: python test_pyc.pyc ? I'm trying to avoide having to write python on the command line. Of course, I could write the wrapper is bourne shell, but that interoduces other problems (especially when considering that my real application needs to parse many command line options). . Bye, Ron.
-- http://mail.python.org/mailman/listinfo/python-list