[SOLVED] seeking GUI apps & utils written in python
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
- SaintDanBert
- Level 4
- Posts: 449
- Joined: Sat Feb 20, 2010 4:04 pm
- Location: Covington, LA USA
[SOLVED] seeking GUI apps & utils written in python
Colleagues,
Will someone direct me to GUI-based apps and utilities that are written in python and part of Linux Mint 18 or later? Alternately, is there some way to detect that some installed app or utility is python-based with some sort of command line inspection?
I would fetch the source package and start reading. I might even borrow parts of the package to start my own project. I would hope to find packages that include mainstream Linux Mint desktop {I use Cinnamon} compatible GUI programming along with contemporary object oriented design. In addition to leaning how to implement and document a reasonable user experience, I need to discover how to do many of the things that I'm used to doing with bash shell scripts. Lastly, I hope to learn effective ways to manage structured data, log files, and such.
I've been coding in C, C++, and Bourne/BASH shell since 80s. Now that I'm retired, I've started teaching myself python. I try to learn good coding by reading, er, "good code." This has worked for me over the years so I'm prone to continue that effort.
Thanks in advance,
~~~ 0;-Dan
Will someone direct me to GUI-based apps and utilities that are written in python and part of Linux Mint 18 or later? Alternately, is there some way to detect that some installed app or utility is python-based with some sort of command line inspection?
I would fetch the source package and start reading. I might even borrow parts of the package to start my own project. I would hope to find packages that include mainstream Linux Mint desktop {I use Cinnamon} compatible GUI programming along with contemporary object oriented design. In addition to leaning how to implement and document a reasonable user experience, I need to discover how to do many of the things that I'm used to doing with bash shell scripts. Lastly, I hope to learn effective ways to manage structured data, log files, and such.
I've been coding in C, C++, and Bourne/BASH shell since 80s. Now that I'm retired, I've started teaching myself python. I try to learn good coding by reading, er, "good code." This has worked for me over the years so I'm prone to continue that effort.
Thanks in advance,
~~~ 0;-Dan
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: seeking GUI apps & utils written in python
Behold the wonders of GitHub:
https://github.com/linuxmint?language=python
Although I wouldn't necessarily call all of Mint's Python "good code" - or at least not up to date code. Also some of the performance-relevant quirks about Python are not self-evident from reading the code. The rest is easy to learn though. I taught myself Python last year to mess around with Mint's code, based on an experience with mostly C-dialects as well. The language was trivial to pick up, and the online documentation is quite good. Speaking of documentation, I just love this site https://learnxinyminutes.com/docs/python3/ to get a quick overview over a programming language's structure.
https://github.com/linuxmint?language=python
Although I wouldn't necessarily call all of Mint's Python "good code" - or at least not up to date code. Also some of the performance-relevant quirks about Python are not self-evident from reading the code. The rest is easy to learn though. I taught myself Python last year to mess around with Mint's code, based on an experience with mostly C-dialects as well. The language was trivial to pick up, and the online documentation is quite good. Speaking of documentation, I just love this site https://learnxinyminutes.com/docs/python3/ to get a quick overview over a programming language's structure.
- SaintDanBert
- Level 4
- Posts: 449
- Joined: Sat Feb 20, 2010 4:04 pm
- Location: Covington, LA USA
Re: seeking GUI apps & utils written in python
I will check this out. I've not made the move to 'git'. I'm still a CVS & Emacs guy. Of course my projects are now "just me." I plan to explore subversion and git and friends while I'm re-learning. I welcome your suggestions for a python development environment and workflowgm10 wrote: ⤴Thu Jul 04, 2019 11:24 am Behold the wonders of GitHub:
https://github.com/linuxmint?language=python
As with learning any "language" it is the use of "idioms" and "slang" that can make things very difficult. It also separates a "native speaker" from a "tourist." Once I got beyond the tab formatting challenge (very foreign to a C/C++ guy) coding came very quickly. As a long-time user of Linux Mint, I want to learn "Mint-style", "Mint-convention", and appropriate implementation idioms. What is common practice for:gm10 wrote: ⤴Thu Jul 04, 2019 11:24 am Although I wouldn't necessarily call all of Mint's Python "good code" - or at least not up to date code. Also some of the performance-relevant quirks about Python are not self-evident from reading the code. The rest is easy to learn though. I taught myself Python last year to mess around with Mint's code, based on an experience with mostly C-dialects as well. The language was trivial to pick up, and the online documentation is quite good. Speaking of documentation, I just love this site https://learnxinyminutes.com/docs/python3/ to get a quick overview over a programming language's structure.
- embedded documentation
- unit testing
- object oriented design and implementation
- available "package"/"module"/"component" use
- deployment of "components" that I've built -- for one app; for multiple apps
- patches and updates to what I've built
- distribution of my app/util to others
"Working code often makes for an effective specification."
Thanks for the reply,
~~~ 0;-Dan
Re: seeking GUI apps & utils written in python
I'm pretty sure almost all (some as bash) the "mintXXX" programs are written in python:
$ W mint
Then you can see each one with something like
$ W mint
Code: Select all
mint-release-upgrade
mint-release-upgrade-root
mint-remove-application
mint-switch-to-local-mirror
mint-xfce-delete
mintbackup
mintinstall
mintinstall-fp-handler
mintinstall-remove-app
mintinstall-update-flatpak
mintinstall-update-pkgcache
mintlocale
mintlocale-im
mintreport
mintstick
mintupdate
mintupdate-cli
mintupdate-disable-auto-updates
mintupdate-enable-auto-updates
mintupdate-launcher
mintupdate-tool
mintwelcome
mintwelcome-launcher
sha256sum-mint
Code: Select all
vi `which mint-release-upgrade`
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Your data and OS are backed up....right?
Re: seeking GUI apps & utils written in python
You will have to learn git if you want to do open source in general and Mint in particular, there's no way around it. It's far more powerful than svn though once you get the hang of it. For a development environment everybody has their own preference. Personally I've always been using Microsoft's Visual Studio Code as the code editor (it's got great extensions for simplifying your work with git, too), whereas most of the team still uses Sublime I believe.SaintDanBert wrote: ⤴Thu Jul 04, 2019 12:09 pm I will check this out. I've not made the move to 'git'. I'm still a CVS & Emacs guy. Of course my projects are now "just me." I plan to explore subversion and git and friends while I'm re-learning. I welcome your suggestions for a python development environment and workflow
For me dropping the semi-colon came harder than using the tabs (or rather not using the curly brackets).SaintDanBert wrote: ⤴Thu Jul 04, 2019 12:09 pm As with learning any "language" it is the use of "idioms" and "slang" that can make things very difficult. It also separates a "native speaker" from a "tourist." Once I got beyond the tab formatting challenge (very foreign to a C/C++ guy) coding came very quickly.
Mint's coding style guidelines are here: https://linuxmint-developer-guide.readt ... ding-style although personally I'd say try to write the best Python you can no matter what's currently in use in Mint. I know the style of the code I contributed was in parts quite different from what was originally there, and that despite trying to "fit" into the existing code base already (my personal style differs quite a bit in structure actually, I prefer splitting a project into several modules and files - see my version of mintupdate in my PPA vs the offical release version, for example -- the lack of OOP in some parts of that app is deplorable, by the way, certainly something that should be improved upon rather than imitated IMHO).
The only shared python module is the mint-common package, which I extended and turned into separate sub-modules for 19.2 (the changelog module in there was actually the first python project I ever wrote - to teach me the language ).
This really depends on what you are planning to do, i.e. if you're planning to contribute to the project or just do your own thing within the project's environment. If you want to contribute to and deploy with official Mint then join their communication channels and discuss it with Clem. Otherwise you are free to do whatever you want - since we're Ubuntu based you can just pop up a PPA for free and do it that way just like I'm currently doing.SaintDanBert wrote: ⤴Thu Jul 04, 2019 12:09 pm [*]deployment of "components" that I've built -- for one app; for multiple apps
[*]patches and updates to what I've built
[*]distribution of my app/util to others
Re: seeking GUI apps & utils written in python
I've only dabbled with Python because I find the whole indenting thing really hard to get over. Reminds me of COBOL and FORTRAN (although not as bad) where certain things had to start in certain columns. I know I just need to accept it if I want to use Python but still...SaintDanBert wrote: ⤴Thu Jul 04, 2019 12:09 pm Once I got beyond the tab formatting challenge (very foreign to a C/C++ guy) coding came very quickly.
Like gm10 I really like Microsoft's Visual Studio Code editor. It has built-in support for Git, although I haven't used that part of it yet.
Running Mint 19.3 Cinnamon on an Intel NUC8i5BEH with 16GB RAM and 500GB SSD
- SaintDanBert
- Level 4
- Posts: 449
- Joined: Sat Feb 20, 2010 4:04 pm
- Location: Covington, LA USA
Re: seeking GUI apps & utils written in python
Thanks for this approach!
I was able to use find to locate a group of "mint*" files.
I then used file {filename} to locate those that were python scripts. file /usr/bin/mintupdate
/usr/bin/mintupdate: Python script, ASCII text executable
Code: Select all
prompt$ file /usr/bin/mintupdate
/usr/bin/mintupdate: Python script, ASCII text executable
Code: Select all
#!/usr/bin/python3
import os
import subprocess
import argparse
if __name__ == "__main__":
# Parse arguments
parser = argparse.ArgumentParser(prog="mintupdate", description="The Linux Mint Update Manager")
parser.add_argument("-v", "--version", action="version", version=subprocess.getoutput("/usr/lib/linuxmint/common/version.py mintupdate"), help="Display the current version")
args = parser.parse_args()
command = "/usr/lib/linuxmint/mintUpdate/mintUpdate.py show &"
os.system(command)
# end
Rinse & Repeat
In the process of reading these python files, my first "lesson" involved learning what all of these do and where they come from:
Code: Select all
import os
import sys
import gi
import tempfile
import threading
import time
import gettext
import io
import json
import tarfile
import urllib.request
import proxygsettings
import subprocess
import pycurl
import datetime
import configparser
import traceback
import setproctitle
~~~ 0;-Dan
Re: seeking GUI apps & utils written in python
Here's a couple of hints -SaintDanBert wrote: ⤴Fri Jul 05, 2019 12:02 pmThanks for this approach!
I was able to use find to locate a group of "mint*" files.
I then used file {filename} to locate those that were python scripts. file /usr/bin/mintupdate
/usr/bin/mintupdate: Python script, ASCII text executableCode: Select all
prompt$ file /usr/bin/mintupdate /usr/bin/mintupdate: Python script, ASCII text executable
'which' shows the path to an executable, so you can do
Code: Select all
$ file `which mintupdate`
/usr/bin/mintupdate: Python script, ASCII text executable
$ cat ~/bin/W
Code: Select all
#!/bin/bash
#
if [ $# -lt 1 ]
then
echo Usage: `basename $0` pattern
exit 1
fi
echo $PATH | sed 's/^/ls -A /' | sed 's/:/ |grep -i '$1'; ls -A /g' | sed 's/$/ |grep -i '$1'/' | bash | sort
exit 0
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Your data and OS are backed up....right?