![]() Now to create the executable, navigate with the console (cmd.exe) to the folder where the script of python is located (in this case Desktop\pythonScripts): cd C:\Users\sdkca\Desktop\pythonScripts Print ("Please answer yes or no !, the setup will start again")Īs you can see, it is a simple console Python application. Print ("File succesfully created, come back soon !") Print ("Awesome, now provide the content of the file !)")Ĭonfirm = input("> Do you want to continue with the creation of " + filename + ".txt ? (Yes/No)").lower() Print ("To get started, give a name to your file (without extension)") Print ("Hi, welcome to Text File Creator 2000") # raw_input returns the empty string for "enter" The filename of the script is file-creator.py and contains the following code (it just prompt the user for the name of a new file and the content): def start_setup(): ![]() The creation of an executable using pyinstaller is very straightforward, customizable and very easy to do. In our example, we are going to create an executable of the following script. To check if pyinstaller was correctly installed, you can check if it's available in the console as an environment variable executing pyinstaller -h. You can read more about this package in the official website. The installation will proceed and you'll have available pyinstaller in your environment: To download pyinstaller, execute the following command in your command prompt (cmd.exe): pip install pyinstaller To create our executable, we are going to use the pyinstaller package. In this article, you'll learn how to create an executable from a Python console script easily using Pyinstaller in windows. exe (yeah, application files) files with python scripts, thanks to pyinstaller. PyInstaller is a program that freezes (packages) Python programs into stand-alone executables, under Windows, Linux, Mac OS X, FreeBSD, Solaris and AIX. ![]() Instead of work repetitively with the console executing your scripts manually in the console, you need to know that there's an easy way to execute them and even create little console applications with them in Windows. ![]() Are you one of those developers that create scripts to make their own life easier? coincidentally, do you like Python? and you have Windows?. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |