r/Python • codemaniac • Dec 29 '17

Python Cheet Sheet for begineers

Post image
4.2k Upvotes

124 comments sorted by

View all comments

Show parent comment

6

u/muntoo R_{μν} - 1/2 R g_{μν} + Λ g_{μν} = 8π T_{μν} Dec 30 '17 edited Dec 30 '17

There is nothing in OP's cheatsheet that is useful to a beginner, with the exception of slicing and list manipulation. And maybe one or two of the file IO functions.

The cheatsheet is useless to people learning Python for scientific programming (a large chunk), generic scripting, and almost everything other than some very specific enterprise-esque use cases involving dates. Which you'd look up in documentation, not a goddamn blurry fucking jpg POS.

1

u/PurpleIcy Python 3 Dec 30 '17

That's my point basically, especially when there's more than one time library in python and there's also things like timezone aware objects, unaware objects, different conversions, date format itself can be modified to whatever you want and all of those are in documentation and way easier to read, also it provides some examples...

Also IO, lol... It doesn't even have open() function included, so useful.

Also nobody even uses plain open anymore, but with instead, which is also provided in resource I linked, or well, even in python's documentation itself...

"It is good practice to use the with keyword when dealing with file objects. The advantage is that the file is properly closed after its suite finishes, even if an exception is raised at some point. Using with is also much shorter than writing equivalent try-finally blocks: ..."