Bottom Page

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
Quote
#2
you can cet part of what you need here: http://www.discoversdk.com/blog/how-to-c...hon-module
Quote
#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.
My code examples are always for Python >=3.6.0
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to keep a loop containing a web import working in python executable? coder1384 3 80 7 hours ago
Last Post: snippsat
  Error while trying to see Python version with "sys.executable" karkas 5 179 Feb-09-2020, 01:55 AM
Last Post: karkas
  How do you add the results together each time a function is called? Exsul 10 689 Aug-09-2019, 09:18 PM
Last Post: ichabod801
  Called Functions Not Working WhatAmIDoing09 3 305 Jul-12-2019, 07:02 PM
Last Post: ichabod801
  Package python script which has different libraries as a single executable or script tej7gandhi 1 413 May-11-2019, 08:12 PM
Last Post: keames
  can't install package web in version python 3.7 a21250450 1 480 Mar-29-2019, 11:28 AM
Last Post: Larz60+
  Help with understanding a python package pyhill00 4 545 Mar-21-2019, 12:42 AM
Last Post: Larz60+
  Getting error when called through instance method aankrose 2 473 Mar-02-2019, 07:19 PM
Last Post: aankrose
  new python package test ramkrishna 0 287 Feb-25-2019, 12:18 PM
Last Post: ramkrishna
  Compiling a Python Package on Windows nagymusic 2 783 Jan-29-2019, 12:08 AM
Last Post: nagymusic

Forum Jump:


Users browsing this thread: 1 Guest(s)