seeking "coding conventions" for python-based project

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
User avatar
SaintDanBert
Level 4
Level 4
Posts: 237
Joined: Sat Feb 20, 2010 4:04 pm
Location: Austin, TX USA

seeking "coding conventions" for python-based project

Post by SaintDanBert » Mon Jul 16, 2018 5:36 pm

Is there a published set of coding conventions or guidelines or similar for writing python applications and utilities withing Linux Mint?

I've looked a a few of the python-based applications and utilities as source packages and they all seem to follow a similar but different set of coding behaviors. Am I missing something?

Thanks in advance,
~~~ 0;-Dan
All government spending, regardless of the motives, uses YOUR money!
Any government extensive enough to give you anything that you want is also
powerful enough to take everything that you have.

User avatar
richyrich
Level 19
Level 19
Posts: 9027
Joined: Mon May 04, 2009 8:31 pm

Re: seeking "coding conventions" for python-based project

Post by richyrich » Mon Jul 16, 2018 7:04 pm

Here's a link to a pretty basic online Python tutorial, with references and examples. It may be too simple for what you are looking for, but it does have some good info . . (don't miss those green Next buttons, or the link to the official Python website) :-)

https://www.w3schools.com/python/default.asp

User avatar
SaintDanBert
Level 4
Level 4
Posts: 237
Joined: Sat Feb 20, 2010 4:04 pm
Location: Austin, TX USA

Re: seeking "coding conventions" for python-based project

Post by SaintDanBert » Tue Jul 17, 2018 5:21 pm

richyrich wrote:
Mon Jul 16, 2018 7:04 pm
Here's a link to a pretty basic online Python tutorial, with references and examples. It may be too simple for what you are looking for, but it does have some good info . . (don't miss those green Next buttons, or the link to the official Python website) :-)

https://www.w3schools.com/python/default.asp
Thanks for this...

I'm surprised that the Mint family (Mint<--*buntu<-- Debian) don't have a style guide or similar.
If one exists, I wish someone would tell me where to find it.

ASIDE -- I fetched the source package for mintUpdate. Um, er, very few comments. The modularization seems okay during a quick review.
I taught C/C++ at a major university and would only give the package code a high-C or low-B grade again based on a quick review.
That is one man's opinion -- mine, so please don't flame this posting.

A RELATED QUESTION:
What are folks using as an IDE for python app/util development. I'm using emacs with the python mode extension
during my code review but would like to learn something more mainstream. Yes, I'm working to learn python, but I've been
carving code since the late 70's (MS '79, GA Tech).

Thanks in advance,
~~~ 0;-Dan
All government spending, regardless of the motives, uses YOUR money!
Any government extensive enough to give you anything that you want is also
powerful enough to take everything that you have.

User avatar
Alexiy
Level 3
Level 3
Posts: 170
Joined: Wed Mar 23, 2016 12:24 pm

Re: seeking "coding conventions" for python-based project

Post by Alexiy » Wed Jul 18, 2018 10:29 am

As an IDE I can suggest PyCharm, but I haven't learned python that much to recommend something else. Default IDE for python is IDLE (https://docs.python.org/3/library/idle.html), and it is included in the packages. Default UI toolkit is Tkinter (https://docs.python.org/3/library/tkint ... le-tkinter), although PyQt is a good option.

User avatar
richyrich
Level 19
Level 19
Posts: 9027
Joined: Mon May 04, 2009 8:31 pm

Re: seeking "coding conventions" for python-based project

Post by richyrich » Wed Jul 18, 2018 8:20 pm

What? No coding conventions at the official Python website? . . . I'm shocked! :shock:

gm10
Level 12
Level 12
Posts: 4131
Joined: Thu Jun 21, 2018 5:11 pm

Re: seeking "coding conventions" for python-based project

Post by gm10 » Wed Jul 18, 2018 8:54 pm

richyrich wrote:
Wed Jul 18, 2018 8:20 pm
What? No coding conventions at the official Python website? . . . I'm shocked! :shock:
Sure there is, always has been: https://www.python.org/dev/peps/pep-0008

edit in response to post below: there really is a Mint-specific style guide? wow
Last edited by gm10 on Thu Jul 19, 2018 4:22 am, edited 1 time in total.

User avatar
smurphos
Level 8
Level 8
Posts: 2022
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: seeking "coding conventions" for python-based project

Post by smurphos » Thu Jul 19, 2018 12:50 am

See - http://linuxmint-developer-guide.readth ... en/latest/

It's not much but it is there....

andyO
Level 2
Level 2
Posts: 51
Joined: Fri Mar 20, 2015 9:34 am

Re: seeking "coding conventions" for python-based project

Post by andyO » Thu Jul 19, 2018 5:25 am

For an IDE, my preference for working is Wing, the debug probe feature is quite powerful:
https://wingware.com/

Eclipse is also good for Python I believe:
https://www.eclipse.org/ide/

User avatar
SaintDanBert
Level 4
Level 4
Posts: 237
Joined: Sat Feb 20, 2010 4:04 pm
Location: Austin, TX USA

Re: seeking "coding conventions" for python-based project

Post by SaintDanBert » Sat Jul 21, 2018 6:45 pm

gm10 wrote:
Wed Jul 18, 2018 8:54 pm
...
Sure there is, always has been: https://www.python.org/dev/peps/pep-0008

edit in response to post below: there really is a Mint-specific style guide? wow
Does Mint use the PEP8 style or something else? I'm confused...
I did fetch the pep8 package and am looking at what it offers.

Thanks in advance,
~~~ 0;-Dan
All government spending, regardless of the motives, uses YOUR money!
Any government extensive enough to give you anything that you want is also
powerful enough to take everything that you have.

Post Reply

Return to “Software & Applications”