Running scripts without installing Python?

H

hepp

Is it possible to run a Python script in Windows without installing
Python on your machine first?

At my work we are using a mixed environment - some have Solaris
workstations and others PC's. I have written an application in
wxPython that runs in both Unix and Solaris. For the Unix version I
put an installation of Python on a network drive that everybody can
access, but in Windows everybody has to download Python and wxPython
before they can run the application.

Is it possible to put a global installation on a network drive in
Windows as well? I tried, but then it complained that it couldn't find
some dll files when I ran the application from another computer.

I have also tried to compile the application to an executable binary
with py2exe, but it didn't work properly.
 
J

Jason Zheng

hepp said:
Is it possible to run a Python script in Windows without installing
Python on your machine first?

At my work we are using a mixed environment - some have Solaris
workstations and others PC's. I have written an application in
wxPython that runs in both Unix and Solaris. For the Unix version I
put an installation of Python on a network drive that everybody can
access, but in Windows everybody has to download Python and wxPython
before they can run the application.

Is it possible to put a global installation on a network drive in
Windows as well? I tried, but then it complained that it couldn't find
some dll files when I ran the application from another computer.

I have also tried to compile the application to an executable binary
with py2exe, but it didn't work properly.
How about compiling it to binary code?
http://starship.python.net/crew/theller/moin.cgi/Py2Exe
 
V

vincent wehren

hepp wrote:
....>
Is it possible to put a global installation on a network drive in
Windows as well?
Sure.
I tried, but then it complained that it couldn't find
some dll files when I ran the application from another computer.
What dll's did give you trouble?
 
G

Gary Herron

Is it possible to run a Python script in Windows without installing
Python on your machine first?

If you just pick up the whole directory structure and put it on a
machine that's never seen python, it will mostly work. Several things
can fail, but there are work-arounds that are not too difficult:

The module search path (stored by Python in sys.path) may not pick
everything up. Running python.exe from the directory it resides
in will mostly fix this up. Your python script may need
to explicitly append some paths to sys.path before doing other
imports. (Yuck -- but not too bad.)

Windows won't find any of the DLL's that get installed in the
system32 directory -- the work around is to decide on the working
directory from which your scripts will be run, and copy any needed
DLL's into that directory. Then windows will find them.

I've successfully done this for an application that runs on both
Windows and Linux, using PIL, numarray, PyOpenGL, GTK+, libglade, and
gtglext, as well as buchnes of standard library things. It's not a
picnic, but it can be made to work. Several pieces of win32all need
special care.

Gary Herron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top