Minimal distro requirements for standalone python program....

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

    Minimal distro requirements for standalone python program....

    Hi,

    I need to add a python program (web updater+extras) with a window
    application.
    The same thing as the Online Lord of the Ring game lotrtcg.deciphe r.com.
    When you install their application, it create a subdirectory with very few
    python files*.dll,*.py d,*.pyc.:

    _socket.pyd
    _sre.pyd
    _tkinter.pyd
    (laucher.pyc)
    (lotrotcglauche r.exe)
    python22.dll
    PyWinTypes22.dl l
    tcl83.dll
    tk83.dll
    win32api.pyd
    xlib.pyd
    _MEI\...

    Context: I want to add some python capabilities to my application, but not
    force the user to install the full python distro.
    Questions:
    1- Are these files sufficient? (Too simple to be true!)
    2- Is their some registry/path entries do perform to setup a minimal
    python runtime?

    Other ideas, examples of how to do it in a simple way?

    Thanks
    AL


  • Miki Tebeka

    #2
    Re: Minimal distro requirements for standalone python program....

    Hello AL,
    [color=blue]
    > Context: I want to add some python capabilities to my application, but not
    > force the user to install the full python distro.
    > Questions:
    > 1- Are these files sufficient? (Too simple to be true!)[/color]
    That depends on the application and which modules it uses. All of the
    installers (Installer, py2exe, cx_Freeze ...) will find all the modules
    a given script needs. IIRC they all use of one distutils features.
    [color=blue]
    > 2- Is their some registry/path entries do perform to setup a minimal
    > python runtime?[/color]
    Again, use one of the installers (py2exe seems to be popular). It will
    create a small executable with all the needed modules.

    HTH.
    Miki

    Comment

    • Daniel Dittmar

      #3
      Re: Minimal distro requirements for standalone python program....

      jeuxal_com wrote:[color=blue]
      > Context: I want to add some python capabilities to my application,
      > but not force the user to install the full python distro.
      > Questions:
      > 1- Are these files sufficient? (Too simple to be true!)[/color]

      As python can now inport from .zip, you could add the python files as a
      ..zip:
      - run compileall.py on <pythondir>/Lib to generate .pyc
      - pack all the files into python23.zip
      - if you install python23.zip into the same directory as the .exe, then I
      think the file will already be added to sys.path

      Hints:
      - specify a nonsense directory to the -d option of compileall.py. Otherwise,
      any backtraces will contain plausible filenames that do not exists on that
      machine
      - adding the .py files is optional
      - python will not import .pyd from the .zip file
      [color=blue]
      > 2- Is their some registry/path entries do perform to setup a
      > minimal python runtime?[/color]

      No, python will search for the files relative to the executable.

      Daniel



      Comment

      Working...