2

I am new to Stack Overflow and had a question on a python application I have been working on for a while as part of a fun little personal project. Basically, the app consists of utilizing Selenium to login to my school portal, (I am a college freshman), navigate through a couple of pages and ultimately scrape the data off a page (beautifulsoup) that contains the campus food account balance and transactions. I thought this would be a useful thing to develop because my school makes it pretty difficult to view this information in a timely manner, and my friends and I find ourselves quite often wanting to check our balance. I completed the code that gets this done and have successfully been able to fetch transactions and display them in the console for any account given a valid school portal username and password. I am now using PySimpleGUI to create a clean interface that prompts you to simply input your login information while it attempts to retrieve this information for you. My question from all this is once this GUI is done, is there any possible way to be able to make this an "app" that can be downloaded or sent to friends so that they can use it as well? I do not want to have to send them the python code, packages to install, teach them how to run it in bash, etc. Is there a way to send them this application that they can run that does exactly what I intend for it to do? Sorry if this is unclear, I will try to elaborate if necessary..

Thank you all in advance!!

Nad
  • 31
  • 3
  • Run it off heroku, aws or something similar you mean? – Arundeep Chohan Feb 18 '21 at 23:29
  • @ArundeepChohan if that will enable the app to be run on other devices without needing a python interpreter or certain modules installed, then yes. – Nad Feb 19 '21 at 01:07
  • It will there is also a demo example for heroku to run a simple selenium file. – Arundeep Chohan Feb 19 '21 at 01:29
  • @ArundeepChohan Ah ok, I will check that out. And so this will just enable it to run in some virtual machine in the cloud and then deploy that out to whoever runs an instance of the app? – Nad Feb 19 '21 at 01:41
  • It will allow anyone who goes to your site to run your program – Arundeep Chohan Feb 19 '21 at 02:05
  • pyinstaller will make an app for Mac just like it does for windows. The PSG docs mention this in a section in the main docs called "Creating a Mac App File": https://pysimplegui.readthedocs.io/en/latest/#creating-a-mac-app-file – Mike from PSG Feb 20 '21 at 00:34

1 Answers1

2

The PySimpleGUI documentation (http://www.PySimpleGUI.org) explains that one method that's worked well for distributing PySimpleGUI programs to users that do not have Python installed is using pyinstaller to convert your program into an executable. For windows, this is an EXE file. For Mac, it's an "App". There's a heading specifically for Mac users "Creating a Mac App File"

pyinstaller isn't perfect, but for distributing a PySimpleGUI program that's based on tkinter, it's worked pretty well. The least number of other packages involved the better. If your program only uses PySimpleGUI, then it should work well.

Another route is for your users to run your code in the browser. These are tricky technically as you're using sites that emulate tkinter in the browser.

A couple of known to work in-browser solutions:

  • Trinket - This will enable you to post your code on a website and your users can run the code in their browser. The PySimpleGUI project has a Trinket page at http://Trinket.PySimpleGUI.org
  • repl.it - Another option for running code in the browser. It's more complex than Trinket, but also supports more packages

These 2 online solutions aren't meant for delivering products. They are teaching aids.

Mike from PSG
  • 5,312
  • 21
  • 39