Python Portability--Not very portable?
cmpython at gmail.com
Fri Aug 6 20:24:57 CEST 2010
> As an example, my inexperienced Python partner 30 miles away has gotten
> out of step somehow. I think by installing a different version of numpy
> than I use. I gave him a program we both use months ago, and he had no
> trouble. (We both use IDLE on 2.5). I made a one character change to it
> and sent him the new py file. He can't execute it. I doubt he has
> changed anything in the intervening period.
I'm curious: what was the one character change? And does your
original program still work for him? Why did he install a different
version of numpy if things were working for him?
By the way, posting "x doesn't work" on a forum never gets you
any help, because clairvoyance is not real :D. Posting actual error
messages sample code does.
> A further example. Months ago I decided to see if I could compile a
> program to avoid such problems as above. I planned to satisfy that need,
> and see if I could distribute some simple programs to non-Python
> friends. I pretty well understand the idea,and got it working with a
> small program. It seemed like a lot of manual labor to do it.
As someone mentioned, you don't "compile" anything in Python.
You can make a .exe file, though, using, as you know, py2exe.
I find using GUI2Exe (which requires you have wxPython) to make
much easier and then if you want to be even fancier, use InnoSetup to
make an installer.
Once you get a working script in py2exe/GUI2Exe, it is usually a snap
to make a new version of your .exe after changing your code a bit.
As far as then updating your .exe files with your non-Python friends,
you should search this newsgroup for Esky, which seems like a very
nice idea for doing this very thing.
More information about the Python-list