seeking "coding conventions" for python-based project

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
SaintDanBert
Level 4
Level 4
Posts: 449
Joined: Sat Feb 20, 2010 4:04 pm
Location: Covington, LA USA

seeking "coding conventions" for python-based project

Post by SaintDanBert »

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
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
richyrich

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

Post by richyrich »

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: 449
Joined: Sat Feb 20, 2010 4:04 pm
Location: Covington, LA USA

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

Post by SaintDanBert »

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
User avatar
Alexiy
Level 3
Level 3
Posts: 171
Joined: Wed Mar 23, 2016 12:24 pm

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

Post by Alexiy »

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.
richyrich

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

Post by richyrich »

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

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

Post by gm10 »

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 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

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

Post by smurphos »

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

It's not much but it is there....
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
andyO
Level 2
Level 2
Posts: 79
Joined: Fri Mar 20, 2015 9:34 am

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

Post by andyO »

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: 449
Joined: Sat Feb 20, 2010 4:04 pm
Location: Covington, LA USA

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

Post by SaintDanBert »

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
Locked

Return to “Software & Applications”