Running scripts without installing Python?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hepp

    #1

    Running scripts without installing Python?

    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.
  • Jason Zheng

    #2
    Re: Running scripts without installing Python?

    hepp wrote:[color=blue]
    > 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.[/color]
    How about compiling it to binary code?

    Comment

    • vincent wehren

      #3
      Re: Running scripts without installing Python?

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

      --
      Vincent Wehren[color=blue]
      >
      > I have also tried to compile the application to an executable binary
      > with py2exe, but it didn't work properly.[/color]

      Comment

      • Gary Herron

        #4
        Re: Running scripts without installing Python?

        On Thursday 16 September 2004 12:14 pm, hepp wrote:[color=blue]
        > Is it possible to run a Python script in Windows without installing
        > Python on your machine first?[/color]

        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





        Comment

        Working...