Why in this millenium should Python PEP-8 specify a maximum line length of 79 characters?
Pretty much every code editor under the sun can handle longer lines. What to do with wrapping should be the choice of the content consumer, not the responsibility of the content creator.
Are there any (legitimately) good reasons for adhering to 7...
A little background:
PEP 8 is the Style Guide for Python Code. It contains the conventions all python programmers should follow.
pep8.py is a (very useful) script that checks the code formating of a given python script, according to PEP 8.
Eclipse is a great IDE. With the Pydev extension, it that can be used to develop Python
I run p...
While coding in Python it's better to code by following the guidelines of PEP8.
And while coding for Symbian it's better to follow its coding standards.
But when I code for PyS60 which guidelines should I follow? Till now I have been following PEP8, but this code shows the opposite. Do I need to rework my code?
...
For checking code in python mode I use flymake with pyflakes
Also I want check code style (pep8) with pylint (description on the same page with pyflakes)
This solutions work.
But I can't configure flymake for work with pyflakes and pylint together.
How can I do it?
...
There is probably an easy answer for this, just not sure how to tease it out of my searches.
I adhere to PEP8 in my python code, and I'm currently using OptionParser for a script I'm writing. To prevent lines from going beyond a with of 80, I use the backslash where needed.
For example:
if __name__=='__main__':
usage = '%prog [op...
I would like to get some feedback on these tools on :
features;
adaptability;
ease of use and learning curve.
...
The PEP 8 recommends that modules be imported at the beginning of programs.
Now, I feel that importing some of them at the beginning of the main program (i.e., after if __name__ == '__main__') makes sense. For instance, if the main program reads arguments from the command line, I tend to do import sys at the beginning of the main progr...
Depending on your interpretation this may or may not be a rhetorical question, but it really baffles me. What sense does this convention make? I understand naming conventions don't necessarily have to have a rhyme or reason behind them, but why deviate from the already popular camelCase? Is there a rhyme and reason behind lower_case_with...
Due to the sheer annoyance of figuring out what to Google, I've decided to risk what any reputation I had to ask this rather simple question.
As PEP8 suggests keeping below the 80 column rule for your python program, how can I abide to that with long strings, i.e.
s = "this is my really, really, really, really, really, really, really l...
This is somehow related to question about big strings and PEP8.
How can I make my script that has the following line PEP8 compliant ("Maximum Line Length" rule)?
pub_key = {
'e': 3226833362680126101036263622033066816222202666130162062116461326212012222403311326222666622610430466620224662364142L,
'n': 22642100386104124846282622610...
I have written some Python in which some lines exceed 80 characters in length, which is a threshold I need to stay under. How can I adapt my code to reduce line lengths?
...
Hello Stack Overflow,
I have come upon a couple of lines of code similar to this one, but I'm unsure how I should break it:
blueprint = Blueprint(self.blueprint_map[str(self.ui.blueprint_combo.currentText())], runs=self.ui.runs_spin.text(), me=self.ui.me_spin.text(), pe=self.ui.pe_skill_combo.currentIndex())
Thanks in advance
...
Hi folks,
I'm just wondering, I often have really long python files and imports tend to stack quite quickly.
PEP8 says that the imports should always be written at the beginning of the file.
Do all the imported libraries get imported when calling a function coded in the file? Or do only the necessary libraries get called?
Does it m...
Do you know any style guide for Python like "Code Like a Pythonista"?
I found chapter 2.3.4 of Expert Python Programming very interesting too.
...
Hi.
I am interested in knowing what is the Python convention for new lines between the program? For example, consider this:
import os
def func1():
def func2():
What should be the ideal new line separation between:
the import modules and the
functions?
the functions themselves?
I have read PEP8, but I wanted to confirm the abov...
Textmate has a Python PEP8 bundle that will run pep8 validation on your file. How can I set it to do the equivalent of pep8 --ignore=E501 my_file.py?
...
Possible Duplicate:
Common Pitfalls in Python
I'm learning Python and I come from a diverse background of programming languages. In the last five years, I've written quite a bit of Java, C++, VB.Net, and PHP. As many of you might agree, once you learn one programming language, learning another is just a mater of learning the d...
I'm starting to use PyQt in some projects and I'm running into a stylistic dilemma. PyQt's functions use camel case, but PEP8, which I prefer to follow, says to use underscores and all lowercase for function names. So on the one hand, I can continue to follow PEP8, meaning that my code will have mixed functions calls to camel case and ...
Are all PEP 8 rules still valid?
Are there any which are obsolete?
Isn't there a more explanatory cheat sheet that this one.
...
The title says most of it really :)
Over the years, the more Python I write, the more I find myself agreeing with most of the guidelines, some though I consistently and intentionally break for my own reasons.
I'd be curious to know what in PEP 8 (or other PEPs too maybe) people religiously stick to and why, and what people find inconven...