Python Cheat Sheet
Not mine,found it on reddit.I submitted this here because I thought it might be useful to some people.
Here is the original link: http://www.reddit.com/r/Python/comments/zbwme/is_anyone_interested_in_the_python_cheat_sheet_i/
(
34 comments
| 143 points
| on HN
)
> list1.extend(object1): Extends list1 with object1 creating a whole list instead of append which jams a an object inside the list.
Extend takes an iterable and not an object. Not sure I can even comprehend that sentence.
> dictionary1.update(dictionary2): updates dictionary1 with values from identical keys in dictionary2
Identical to what? Update adds all key-value pairs from dictionary2. I guess the text might refer to the fact that update overwrites existing values.
> ‘string1’.strip(): Returns one string with whitespace removed.
Only at the start and end of the string.
> ’string1’.count(object1): Returns the number of times that object1 appears in string1.
This method doesn't exist as far as I can tell and I'm not sure how an object "appears" in a string.
Make a better one and get it to the front page of HN.
This is better described in python's native help documentation:
searching for extend via '/extend': Concise and correct.http://rgruet.free.fr/PQR27/PQR2.7.html
Other versions available.
Go to the page and search for your thing, easy.
But, one reason I like Python is it's small and regular enough to not need a cheat sheet (this does not apply to stdlib which has large swaths of wtfness, and is changing as people keep bloating up the language, ternary)
And, any decent editor should be highlighting, tab completing and hooked into pyhelp to provide a context aware , dynamic, interactive "cheat sheet". E.g vim with following vim plugins pydoc, python_calltips, supertab and proly should throw in pep8 and pyflakes. Check it -> https://github.com/njharman/dotfiles
Here is the original link: http://www.reddit.com/r/Python/comments/zbwme/is_anyone_inte...
Please use non-proprietary document formats. It's the polite thing to do. http://www.fsf.org/campaigns/opendocument/reject
Be sure to tell them about Linux while you're harping on their file format choice.
Sorry, but it sounded really weird to me to ask for politeness in this context. What I would do is suggesting the change of format, or even better do it by myself if that would be bothering me that badly. Just saying...
[1] http://ipython.org/
[2] http://bpython-interpreter.org/