Python Forum
Questions re: my first python app (GUI, cross-platform, admin/root-level commands)?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Questions re: my first python app (GUI, cross-platform, admin/root-level commands)?
#1
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Cross 2 arrays dylan261999 4 1,020 Feb-09-2023, 01:06 PM
Last Post: thensun
  python manage variables across project level mg24 1 912 Nov-12-2022, 05:01 AM
Last Post: deanhystad
  Sending string commands from Python to a bluetooth device Rovelin 13 9,434 Aug-31-2021, 06:40 PM
Last Post: deanhystad
  Python library for win32 console commands eldiener 3 3,448 Aug-24-2021, 10:28 PM
Last Post: bowlofred
  [split] Could you please clarify where i did mistake also how run without admin right Abubakkar 1 1,784 Jun-14-2021, 09:32 AM
Last Post: Larz60+
  Possible to execute a python script before log off/shutdown with input commands? Kaltex 1 2,257 May-18-2021, 06:31 AM
Last Post: Skaperen
  Using python to execute app or cmd that requires admin credentials thewolf 0 2,102 Mar-05-2021, 08:15 PM
Last Post: thewolf
Photo Locate Noise floor level for a spectral data in Python Ranjan_Pal 1 3,038 Dec-19-2020, 10:04 AM
Last Post: Larz60+
  platform binary representation --- 3 questions Skaperen 4 2,761 Dec-05-2020, 03:50 AM
Last Post: Skaperen
  Raspi Commands via Python (VS Code) Script AS4188 5 2,790 Oct-21-2020, 03:49 PM
Last Post: AS4188

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020