Distribution of Python Scripts
Jean-Michel Pichavant
jeanmichel at sequans.com
Fri Nov 19 05:43:26 EST 2010
tazz_ben wrote:
> Hi Folks -
>
> I'm an experienced programmer, but this is my first app with python,
> so I apologize for any stupidity on my part. So I've written/still
> working on a command line tool written in Python. It talks to a web
> service, so there really isn't anything in it that is dependent on a
> particular os. My goal is to distribute the script as a tool to my
> users so they can use it (they are on multiple platforms), the vast
> majority are not programmers.
>
> So, I'm looking for a way to distribute the app that takes care of
> details like them having python installed, or having an older version
> etc. From reading some docs it sounds like "Squeeze" did exactly this
> back in the day, but it is ancient and I'm writing in 2.7. Just to
> be clear I could care less if they see the source code, my goal is all
> around ease of use. I would love to have one distribution file for
> all platforms, but I can live with making three if that's the only
> option.
>
> So, what's my options.
>
I've never done that before. So maybe I will give you a very bad idea,
but if so, I'm confident that ppl in this list will scream about it :)
You can ship your app with python (the executable) and the module you're
using as local modules.
Let's assume you are importing sys and os:
myApp/python.exe
myApp/myScript.py
myApp/os/__init__.py -> actually the whole package
myApp/sys/__init__.py
If you see what I mean.
by running python.exe myScript.py ... That should work.
You'll have to include every single module you are using. Only
python.exe would required to be platform specific.
Maybe that's a terrible thing to do... :D
JM
More information about the Python-list
mailing list