There is probably a simple answer for this, just not sure how to mock my searches.
I adhere to PEP8 in my Python code and now I am using OptionParser for the script that I am writing. So that the lines do not exceed 80, I use backslash when necessary.
For example:
if __name__=='__main__': usage = '%prog [options]\nWithout any options, will display 10 random \ users of each type.' parser = OptionParser(usage)
This indent after a backslash results in:
~$ ./er_usersearch -h Usage: er_usersearch [options] Without any options, will display 10 random users of each type.
This gap after the "random" errors of me. I could do:
if __name__=='__main__': usage = '%prog [options]\nWithout any options, will display 10 random \ users of each type.' parser = OptionParser(usage)
But it makes me so terrible. This seems silly:
if __name__=='__main__': usage = ''.join(['%prog [options]\nWithout any options, will display', ' 10 random users of each type.']) parser = OptionParser(usage)
Should there be a better way?
python wrapping pep8
EMiller Aug 19 '09 at 20:10 2009-08-19 20:10
source share