On 30 jul 2009, at 12:57, Chris Rebert wrote:

On Thu, Jul 30, 2009 at 3:42 AM, Barak, Ron<ron.ba...@lsi.com> wrote:


________________________________
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

No, with the shebang line (and assuming execute permissions on the
file), it would look like:

./wrapper.py

(or just `wrapper.py` depending on whether the file is placed in the $PATH)

Cheers,
Chris


yes exactly, chris

you can distribute a pyc containing your program, and have the wrapper.py execute it

gr
Arno --
http://mail.python.org/mailman/listinfo/python-list

Reply via email to