![]() ![]() Os.startfile("C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe")ĩ. We need to use double \\ in the path as Python uses \ to insert illegal characters into a string. The startfile function requires the use of a full file path to the application. The first checks reply to see if it contains “Google Chrome” if so it will open the Google Chrome browser. Use a conditional statement to read the value stored in reply and compare it to three conditions. reply = easygui.buttonbox(msg, title, choices=choices)Ĩ. The chosen application is stored in the reply object. In this case we use a button box from EasyGUI, each button is an option from the choices list. Create an object, reply, to ask the user a question. Each item has a numerical index, starting from zero. Create a list, choices, and inside store three values which are the application names. Title="Tom's Hardware Application Starter"Ħ. Create two variables, one for a message (msg) to the user while the other becomes the application title. Easygui creates the GUI application and OS enables the code to interact with the operating system. Import two Python modules, easygui and os. We chose to use Notepad++, but you are free to use your favorite editor.Ĥ. Open a text editor to write the Python test script. Open a PowerShell by right clicking on the Windows icon and selecting PowerShell.Ģ. All we need to provide is the logic that drives the application.ġ. ![]() We use the EasyGUI Python library as it abstracts the complexities of creating a GUI application. Our example application is a simple GUI to launch one of three applications. pip install auto-py-to-exe Create a Test Script Use the Python package manager pip to install auto-py-to-exe. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |