Python Forum

Full Version: Questions re: my first python app (GUI, cross-platform, admin/root-level commands)?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm brand new to python and for my first app ("StaySafe"), I want to pop up a randomly chosen message whenever the user launches their web browser. (Details below if you're interested in reading them.)

My intention was to rename the existing executable (e.g. /usr/bin/google-chrome-stable becomes /usr/bin/google-chrome-stable-staysafe) then replace it with my script (renamed using the original executable's filename - /usr/bin/google-chrome-stable). So that any existing menu item, desktop icon, etc. will still launch the browser - but only after displaying a StaySafe reminder message.

I initially tried to write this as a shell script for Linux but you can't execute sudo commands (which are necessary if you're going to be messing around with files in /usr/bin) in a shell script and there's no good way around that limitation. That means I can't make a simple installer which violates one of my criteria. Will I have the same problem with a python script? Or can I somehow tell it to run certain commands as root/Administrator, prompting the user for sudo authentication?
I was planning to use easygui for my messages but it looks like I can't display a message with an image off to the left or right of the text. Is there an alternative that will give me that capability that's just as easy to use? (I'm worried about getting bogged down in the intricacies of tkinter.)
If I want it to be easily installable by novice users, going into installation mode the first time it's run, I'll want it to be executable... what do I need to do/know to make a cross-platform (Windows, Mac, and Linux) executable?
Aside from the click to install/run aspect, how do I make it cross-platform when Windows, Mac, and Linux all keep their executables in different places?

Many thanks for your time and consideration.



TGM StaySafe - A simple program to help keep older folks safe from scammers online

General Concept - when any installed web browser is launched, display one of several randomly chosen messages to remind the user that a phone call from a stranger and/or a web page (telling them that their computer has a problem) is always a scam... to never allow a stranger to remote in to their computer, etc.

Criteria:
* Include a simple installer that a novice user is capable of running without assistance.
* Create a .cfg/.ini file that it can read from/write to.
* Use GUI messages that incorporate images (for branding).
* Keep a count (in the cfg file) of the number of reminders the user has seen.
* Give users an option to disable reminders for a day, 3 days, a week, or permanently disable them.
* Automatically notify me by email when a user permanently disables reminders.
* Cross-platform - works in Windows, Mac, and Linux