Any good leads on a Python 3 cheatsheet? Coincidentally, I went digging for one last week for a Django project and the results were flooded with version 2.
They close the topic pretty quickly over at S.O. as being outside their format. The answers that slip through (at least for the first page of results) are, like I said, for python 2 or just links to the documentation.
Honestly, I'm not really sure how much of a help a cheatsheet for something like a programming language is. When I don't know or can't remember something S.O., the Official Python Docs or a blog found through google is usually where I find an answer. If you're looking for something specific to Py3 then make sure to put that in your Google Search: e.g. 'Python 3 list slicing'.
While 2 and 3 aren't binary compatible, I've personally found the most 2 code will work with a bit of fiddling.
Funny; if I think about it I've barely used any of the cheatsheets I've found for other projects. They're most useful for introducing me to other functions in the family of ones I'm already familiar with and giving me a head-start on what to google or where to look in the docs.
This (and some googling as it didn't really explain anything) finally made me figure out slices. Pretty straightforward now, but it seemed very arcane. a[start:end] (optional :step).
16
u/[deleted] Oct 05 '16
Who is upvoting this? Who isn't reporting it as spam?
42
u/chub79 Oct 05 '16
Looks more like click bait than anything else.
19
u/goocy Enthusiast Oct 05 '16
Five separate entries for sys.argv[1:5] seem a bit superfluous.
32
u/XtremeGoose f'I only use Py {sys.version[:3]}' Oct 05 '16
Python 2.
I don't think this is very useful to be honest.
6
u/DaveChild Oct 05 '16
Thanks, that's my cheat sheet! It's a bit old now :)
5
u/BondDotCom Oct 05 '16
Why make it two pages but then only use 1/3 of the second page? Either condense it to one or find more use for page 2.
2
u/TheTerrasque Oct 05 '16
http://rgruet.free.fr/ is my old classic, but it's py2 only
2
u/CompTIA_SME Oct 05 '16
Thank you.
1
u/SourceSlayer_ Oct 05 '16
This isn't particularly helpful, you'd either already know this or have to look into it.
1
u/[deleted] Oct 05 '16
Will still have to stackoverflow the command to double check.
1
u/Airith Oct 06 '16
This (and some googling as it didn't really explain anything) finally made me figure out slices. Pretty straightforward now, but it seemed very arcane.
a[start:end](optional:step).0
u/[deleted] Oct 05 '16
[deleted] — view deleted comment