Python File Opens and Immediately Closes

Python file opens then immediately closes

You have to go into cmd and go to the directory where you stored the API files then type python setup.py install this is assuming you have python installed. Use cd to navigate to the file location.

Pyinstaller's .exe file closes immediately

It sounds like the script ran to end of file to fast for you to see. You can confirm this by opening your terminal (cmd/poweshell in windows) and running your program like any other CLI tool.

cd path\to\exe
./exe -arguments

Since you launched it from an allready opened terminal it won't close when the script ends.

If this is the problem you can solve it by adding

input("Continue...") # wait for user

Update

As @BokiX says pyinstaller can cause false positives with anti virus software. Try a diffrent one e.g. nuikta:

pip install Nuikta

python -m nuikta main.py

installing python programs vs tradtitional programs

A tradtitional program installer is usualy a fancy zip file with some additianal feautures to setup a program for the relevant system it's on (e.g. make registry changes, download additianal files).

A python program is just a python script that was "frozen" in state so it can run independently on a system without python or it's dependencies. once you have an exe it should just run without needing to be "installed".

using console programs
A console program is a program that is made to be exicuted from a terminal. In modern use these are usualy so they can be run by a script or someone who finds typing is faster than using a GUI.



Related Topics



Leave a reply



Submit