3/2/2024 0 Comments Convert python to exe onlineDownload or copy the result from the “Base64” field.Press the “Encode file to Base64” button.If necessary, select the desired output format.Select a local file from your computer.Guru A virtual teacher who reveals to you the great secrets of Base64 We picked this code on purpose, rather than a simple 10 line application, so that we could try emulating a real life situation.Base64. Self.ax.plot(pd.to_numeric(df), pd.to_numeric(df), color ='tab:blue', picker=True, pickradius=5) Types = Ĭsv_file_path = askopenfilename(initialdir = ".", title = "Open File", filetypes=types) aph = FigureCanvasTkAgg(self.fig, self.canvas) Self.table = Table(self.tableframe, dataframe=pd.DataFrame(), width=300, height=400) Self.tableframe = tk.Frame(self.rightframe, highlightbackground="blue", highlightthickness=5) Self.button3 = tk.Button(self.rightframeheader, text='Generate Plot', command=self.generatePlot, width=10) Self.button2 = tk.Button(self.rightframeheader, text='Clear', command=self.clear, width=10) Self.button1 = tk.Button(self.rightframeheader, text='Import CSV', command=self.import_csv, width=10) Self.rightframeheader = tk.Frame(self.rightframe, background="white") ![]() Self.leftframe = tk.Frame(self.main, background="white") Self.rightframe = tk.Frame(self.main, background="white") Self.main = tk.Frame(master, background="white") Additional settings can also be applied here, some of which we will discuss later.įrom _tkagg import FigureCanvasTkAggįrom tkinter.filedialog import askopenfilename ![]() Shown above is the remaining configuration settings, such as name, description, file paths, and version numbers. executables = [Įxecutable('graphingapp.py', base=base, target_name = 'app') For console applications, we use “console” instead of “Win32GUI”. The base here specifies that our program is a GUI based one. base = 'Win32GUI' if sys.platform='win32' else None This helps reduce the final EXE size, and speed up load time. The second list is for when we wish to exclude certain libraries, which are being detected by cx_Freeze, but are not needed in our application. cx_Freeze will automatically detect 90% of your dependencies/packages, but there are certain situation in which we need to explicitly declare some of them in this list. The first one is a list of packages you wish to include. Lets discuss the cx_Freeze setup file and its contents briefly. Tutorial: How to configure cx_Freeze Setup.py Now we have ourselves a setup file, which looks like this. It’s asking you for the name of the setup file, which is setup.py by default. The last question above can be left as blank (just press enter). (C)onsole application, (G)UI application, or (S)ervice : G Python file to make executable from: graphingapp.py Shown below are the questions we were asked, and our answers. It will ask you several questions, and then create a setup file based on your answers. Cx_Freeze gives us an easy way to create a setup file with default settings using the below command. The setup file on the other hand, can be re-run instantly as all settings are permanent there.Īll you need to do is create a file called “setup.py” and insert the appropriate code. This is especially annoying if you have many special configurations and settings enabled (which is quite common when using cx_Freeze). ![]() ![]() However, we do not recommend the console approach, because you need to re-enter the commands each time you want to compile. Another common approach is to do everything on the console, without having to create a setup file. There are several ways of working with cx_Freeze, but the easiest to manage is using a setup file. Once we are done with the installation, we can begin converting our Python file to an EXE. First, we are going to install cx_freeze using pip (you can use any equivalent method).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |