Python Forum
How can I make a python script create an EXE?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I make a python script create an EXE?
#9
(Aug-21-2018, 03:06 PM)Axel_Erfurt Wrote:
(Aug-21-2018, 02:19 PM)ahmed_mokhles Wrote: Well yes I can do that but what I really want is the python code that can produce an EXE, if that is actually possible.

an exe from what? from your py file?

You can use python to call the 3rd party libs.

this is an example for cxfreeze (mysetup.py)

from cx_Freeze import setup, Executable, build
base = None
myname = "rotateVideo2"
desc = "rotateVideo2"
vers = "1.4"
executables = [Executable("/home/brian/Dokumente/python_files/rotateVideo2.py", base=base, targetName="rotateVideo2")]

build_exe_options = {"packages": ["idna"],
                                     "include_files": [],
                                     "excludes": ["PyQt4,matplotlib"],
                                     "includes": [],
                                    "optimize": 2,
                                    "build_exe": "/tmp/rotateVideo2",
                                    }

setup(
    name = "rotateVideo2",
    options = {"build_exe": build_exe_options},
    version = vers,
    description = desc,
    executables = executables
)
then i can do

python mysetup.py build

and it generates the application from my python file.

This seems to be the most relevant reply. Anyway, I don't understand what's happening in the code so I installed cx freeze and I run "python filename.py build" but it says:

Error:
ImportError: No module named 'idna'
Please can you explain what this is supposed to do and what is causing the error? Thanks
Reply


Messages In This Thread
RE: How can I make a python script create an EXE? - by ahmed_mokhles - Aug-21-2018, 04:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Make entire script run again every 45 mo NDillard 0 343 Jan-23-2024, 09:40 PM
Last Post: NDillard
  Trying to make a board with turtle, nothing happens when running script Quascia 3 718 Nov-01-2023, 03:11 PM
Last Post: deanhystad
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,392 Jun-29-2023, 11:57 AM
Last Post: gologica
  Make console show after script was built with Pyinstaller --NOCONSOLE? H84Gabor 0 1,235 May-05-2022, 12:32 PM
Last Post: H84Gabor
  Make my py script work only on 1 compter tomtom 14 3,953 Feb-20-2022, 06:19 PM
Last Post: DPaul
  How to create a Kibana Visualisation with python script? adzadz 0 1,287 Jul-20-2020, 06:41 AM
Last Post: adzadz
  How to kill a bash script running as root from a python script? jc_lafleur 4 5,980 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  How to make this function general to create binary numbers? (many nested for loops) dospina 4 4,508 Jun-24-2020, 04:05 AM
Last Post: deanhystad
  Make the script read from any directory falahfakhri 2 2,205 Jun-15-2020, 02:18 PM
Last Post: falahfakhri
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 2,334 May-28-2020, 05:27 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

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