Город МОСКОВСКИЙ
00:08:37

Convert py to exe, using cx_freeze python library (Easiest Way)

Аватар
Python кодер
Просмотры:
32
Дата загрузки:
02.12.2023 18:56
Длительность:
00:08:37
Категория:
Обучение

Описание

Make executable from python program , convert py to exe or .py to .exe or python to executable using cx_freeze. Executable which a .exe file ,helps us to run your program as an application. It is also helpful, if you want your application or your program should run on all the system without any problem of dependencies. Executable bundles together all the dependencies and it also contains a .exe or executable file. Cx_freeze is a python module used for making executable of python program.

Download cx_freeze : https://pypi.org/project/cx_Freeze/

setup.py : https://github.com/tdsk15041995/coders_palace_python/blob/master/setup.py

Content of setup.py:
import sys
from cx_Freeze import setup, Executable
setup( name = "Any Name", version = "3.1",
description = "Any Description you like",
executables = [Executable("fox_the_obstacles.py",
base = "Win32GUI")])

fox the obstacles (Python game) : https://github.com/tdsk15041995/python_game_fox_the_obstacles

facebook page : https://www.facebook.com/Coders-Palace-2135383986675010/

steps for converting py to exe:
1. Download and install cx_freeze
2.In the directory containing python program for which a executable has to be made , create a setup.py file
3. Go to command line (Make sure you have navigated to folder containing python program and setup.py) and run "python setup.py director y name"
4. Go the directory to see the magic of cx_freeze , .exe and all the dependencies required are created.

Рекомендуемые видео