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!!
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.
Related
As a training project i have made activity tracker using python (no GUI, only command-line).
Script checks with win32gui/pywin32 and pyautogui what program is currently used, and if it is web browser what web site is in use.
Name of window, date, and amount of time spent on program/website is stored in sqlite3 database.
Then with help of pandas module same names are grouped and time is summed up.
I want to convert this script into web app using django but i am beginner in creating web apps, so i am wondering: is it possible to use this modules within django and is it even possible to create web app that works same as script mentioned earlier?
Sorry if the question is trivial. I will be grateful for every tip where and what exactly to look for in this topic.
Nope.
You can't make a server to connect through a web client/browser and see the other processes. That's a security issue, a big one.
Btw, some GNU/Linux desktop environments won't even allow the same user's processes in the same logged-in session on the same computer to see each other (Wayland).
I have a question regarding the security of my software.
My software downloads RSS feeds from the Internet, parses them, and does things with it. These things include following the url of the posts stored in the RSS feeds, and parsing the original web page of the posts in certain cases.
Of course, the websites providing the RSS feeds often change the design of their websites, which makes my parsing code obsolete each time they do that. I run regular tests that are supposed to flag the changes, but sometimes I miss it.
Each time a change happen, I have to fix the code, repackage the software, make the installers, push the new version to the server, etc (for Mac, Windows and Linux). Just because the parsing part had to be updated. My app is written in Python.
I was thinking about putting the parsing scripts on my server, and make my software download the scripts if the parsing methods changed. But that would imply downloading code from a server, and executing it on the fly.
Is it secure to do something like that? Is there another way?
EDIT:
It should have been more explicit. My software is a PyQt app, a more or less standalone app that the user downloads and install. It's local to the user. The software downloads the RSS feeds from the user's computer. However, the software contacts my server (I control it) to perform a few things: create an account for the user if he doesn't have one, send feedback on the most read RSS feeds, etc.
When I update the software, I have a script to automate most things like building the installers and all, but there are always suprises (like SSL libraries updated on the OS side or any other weird thing), so I'd like to minimize the number of builds. Also, the user has to manually update the software on his side (and we know the user is lazy...)
How can I update a python script remotely. I have a program which I would like to share, however it will be frequently updates, therefore I want to be able to remotely update it so that the users do not have to re-install it every day. I have already searched StackOverflow for an answer but I did not find anything I could understand. Any help will be mentioned in the projects credit!
A very good solution would be to build a web app. You can use django, bottle or flask for example.
Your users just connect to your url with a browser. You are in complete control of the code, and can update whenever you want without any action on their part.
They also do not need to install anything in the first place, and browser nowadays provide a lot of flexibility and dynamic content.
I've got a python script that I want to build a locally-hosted web gui app for, so I can use the modern styling and tools available to web apps.
The scripts I'm running take a while to process, and I want to update the web app with visual updates, or at least something akin to what the console sees when using print() in python.
My initial hosting efforts have been based on this tutorial, and I tried out the methods in this answer to try and get data to update in a streamed fashion, but the pages only showed once the entire script was finished.
I'm wondering whether web.py could help me?
Any guidance, or even the right terms to google would be appreciated. Thanks.
--
Update: I've been reading up on node.js (something I've failed to do for years..) and, please correct me if I'm wrong, but it seems like it could be the answer. I'm even considering re-writing my original functions into node.js given the existence of this serial comms library
I am considering to write a plugin/module for one of any of wellknown CMSes like Joomla, Drupal and Plone. I am very impressed with the clarity of many Plone-based sites, and excited with many praises people gave to Plone. Besides, I love Python also. So, I want to give Plone a try. Here a some information about the plugin I want to develop:
I have some Linux commandline programs that I want to run from within the CMS environment via this plugin. The plugin then save command output, run log to the user who runs the programs. The CMS then can take the information and do all other kinds of things like graphical display of data in with graphs, or integrate with search functionality.
So, what do you think? Where should I start? I looked at table of contents for some Plone books but could not find anything close to plugin development.
I think you can't go much wrong with Aspeli's Professional Plone Development, but if you can get a cheap copy of the Definitive Guide to Plone, that'll do, even if it hasn't been updated for Plone4.
We do this all the time.
Plone is written is Python and can do everything what Python can. Python has gained popularity, on expense of Perl, as UNIX scripting language.
For further ideas, if you need to run long tasks, see Long running Plone operation with AJAX progress bar because you usually don't want to block the page loading for the duration of command-line program run.