Python Forum
Best method: Python script called from another app, package as complete executable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best method: Python script called from another app, package as complete executable
#1
Hi,

I am pretty new to Python. I've messed around over the years. I have never packaged or froze a program.

My current project requires me to run a Python script. This python script may have references to other libraries (matplotlib, etc).

But here is where it gets tricky. These are the requirements:
  • Must be able to call script and pass in a couple arguments, like a string
  • The script must be able to be STANDALONE and run on any single Windows computer without need for any installation of other software besides Python.

What is the best way to achieve this and what tools might I look at to do this?

I am complete noob here and don't know where to begin. Thank you
Reply
#2
you can cet part of what you need here: http://www.discoversdk.com/blog/how-to-c...hon-module
Reply
#3
Does the user need to know Python and how to install a package with pip?
If the answer is yes, then the distribution over pip is ok.

If the user has no knowledge, it's better to deploy on Windows a executable with all dependencies.
There are different ways. Currently the lowest hanging fruit comes from PyInstaller. This
packs the Python Interpreter together with the dependencies and the source code in one executable if needed.
Nuitka is different. This module converts Python to C++ and compiles it. There is still an interpreter, but as far
as I know with optimizations from nuitka. This also able to create exe files for Windows.

Another approach is pynsist, which uses the NSIS installer to install the Python Interpreter together with the pip dependencies + provided local wheels all in a installer. It can also be uninstalled.

I don't like it to provide binary files, but sometimes the requirement enforces this.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to run utilities from a Python package? LugosisGhost 1 431 Dec-27-2023, 12:00 PM
Last Post: Larz60+
  Multiple variable inputs when only one is called for ChrisDall 2 488 Oct-20-2023, 07:43 PM
Last Post: deanhystad
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,187 Jun-29-2023, 11:57 AM
Last Post: gologica
  Python Serial: How to read the complete line to insert to MySQL? sylar 1 819 Mar-21-2023, 10:06 PM
Last Post: deanhystad
  Python package not seen in VSCode fmccabe80 6 3,199 Mar-06-2023, 10:01 PM
Last Post: fmccabe80
  package script cant find sibling script when executed from outside Bock 3 870 Mar-03-2023, 04:26 PM
Last Post: snippsat
  Couldn't install a go-game called dlgo Nomamesse 14 3,090 Jan-05-2023, 06:38 PM
Last Post: Nomamesse
  how can a function find the name by which it is called? Skaperen 18 3,447 Aug-24-2022, 04:52 PM
Last Post: Skaperen
  How to compile a Python script for a Windows / Linux executable? netanelst 2 1,316 May-24-2022, 07:02 AM
Last Post: netanelst
  Python multiprocessing Pool apply async wait for process to complete sunny9495 6 6,407 Apr-02-2022, 06:31 AM
Last Post: sunny9495

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020