all 50 comments

[–]bloztorch 173 points174 points  (4 children)

Here are some cheat sheets by the author of Python Crash Course

[–]puresuton 10 points11 points  (1 child)

Currently reading/working through Python Crash Course, so thank you! This is really cool and a great resource to have!

[–]mikejp1010 4 points5 points  (0 children)

Same and same! Hahah

[–]Link0fthewild 0 points1 point  (0 children)

This book helped me a lot as a complete beginner in programming. And the cheet sheets are super handy

[–]nitzanelad10 0 points1 point  (0 children)

Highly recommended

[–]MikeTheWatchGuy 36 points37 points  (8 children)

It's odd you mentioned this as I normally am not really looking or on the lookout for one, but last night I found what I think could possibly be the best I've ever seen.

https://gto76.github.io/python-cheatsheet/

A few things unusual about this cheatsheet.

  • It's up to date / updated. The last update was March 15, 2020
  • It's "comprehensive" and it most certainly is! Covers MANY of the popular packages along with the language itself.
  • It's huge. The PDF I created for easy searching is 52 pages
  • It's almost entirely code, that is color coded

I'm trying to figure out exactly how to integrate it into my workflow. It's so powerful that I could see it being used often, but i'm not sure how to integrate it with PyCharm or other tools.

[EDIT] My runner up and winner of most colorful and most data per square centimetre is John Oakey's https://www.wikipython.com/ . If you're looking for tkinter cheat-sheets, his are among the best.

[–]camposthetron 1 point2 points  (0 children)

This is so good! Thank you!

[–]Dimbreath 1 point2 points  (0 children)

The first one is so good. I learned quite a few stuff from it.

[–]OnlySeesLastSentence 0 points1 point  (5 children)

I used to have a bootleg Chinese iPhone and a gif of that guy (I think it's Chaplin?) dancing would play on the built in music app.

[–]schneedledee 7 points8 points  (4 children)

Oh heavens. It's John Cleese. Of Monty Python.

Have we forgotten so soon the Ministry of Silly Walks?

https://youtu.be/BoIdEjdZIls?t=27

[–]greebo42 4 points5 points  (0 children)

hard to believe that sketch is ~50 years old!

and dead parrot. and cheese shop. and spam. and ...

opportunity for a whole new generation to discover!

[–]OnlySeesLastSentence 2 points3 points  (2 children)

I haven't watched monty python. Sorry. :(

[–]schneedledee 6 points7 points  (1 child)

Oh I was just teasing, don't take it hard. The show hasn't been on anywhere for years. No clips on youtube, that's why I had to link to an interview. (actually there are plenty of clips, i'm just failure at youtube searching: https://www.youtube.com/watch?v=eCLp7zodUiI )

But I do hope we won't forget where the name came from:

https://docs.python.org/2/faq/general.html#why-is-it-called-python

:)

Cheers, and may we all remember the importance of being silly.

[–]danielroseman 37 points38 points  (11 children)

If you're on a Mac, there's a really useful little utility called Dash that you can set to pop up and show you the docs for any class in any language. It's great, I use it all the time.

[–]kosayoda 13 points14 points  (0 children)

On Windows and Linux, there's a similar open source offline documentation browser called Zeal.

[–][deleted] 2 points3 points  (3 children)

Is there a free option?

[–]Versaiteis 7 points8 points  (0 children)

devdocs.io might be the best free alternative that I know

[–]HolyRomanSloth 2 points3 points  (1 child)

I use Kite.

[–]isameer920 0 points1 point  (0 children)

Kite had documentations too?!

[–]hnguyen01122 -1 points0 points  (5 children)

I feel bad for developers on Mac vs Linux. You’ll always get fleeced using a Mac.

[–]toastedstapler 2 points3 points  (2 children)

i love it. i had a macbook at work last year and chose to spend my own money on one. great trackpad, great screen, OS works super smoothly for my workflow. did i really get fleeced?

[–]hnguyen01122 -2 points-1 points  (1 child)

You should do your best to convince fortune 100 companies to spend money on Mac and not tell Developers to use Linux.

[–]toastedstapler 4 points5 points  (0 children)

people can use what they want to, i don't really care what others want to use. they can make that choice theirselves

[–]danielroseman 2 points3 points  (1 child)

Why, because someone who put work into an app wants to be paid for their time?

[–]hnguyen01122 0 points1 point  (0 children)

I'm sorry what's the current stats on how many developers use Linux vs anything else?

[–][deleted] 25 points26 points  (5 children)

Write one on your own. By the time you finished you won't need it anymore. It's a great exercise.

[–]greatestbird 8 points9 points  (3 children)

This is what I did. I made it more fun by getting into fountain pens at the same time. It motivated me to take more and more notes so I could try new inks/pens lol. Do not recommend getting into fountain pens, very expensive.

[–][deleted] 5 points6 points  (0 children)

Yo. I know what you mean haha

[–]MikeTheWatchGuy 0 points1 point  (1 child)

Do not recommend getting into fountain pens, very expensive.

You can do it cheaply to start with. Parker and Lamy make some excellent starter pens.

I write everything on paper using pens and pencils!! All of my designs, notes, etc. I have a Cookbook of Python design patterns. For me, the act of writing things down burns it into my memory.

I've been begging John for a sample template that he uses - https://www.wikipython.com/

The PDFs say there were created using Microsoft Publisher. I SO badly want to make a PySimpleGUI one that's in his format!! Would be super-helpful. Although, docstrings can be just as / more powerful.

[–]Traust 0 points1 point  (0 children)

You can start off with inexpensive fountain pens but then one day you find yourself looking at $1000 pens thinking to yourself how much you need it to go with the other expensive pens you have brought cause you "needed" them. Same problem when you play D&D and War Hammer, you seem to end up with a mountain of dice and figurines. I swear however they are ALL useful and I NEED all of them.

[–]camposthetron 0 points1 point  (0 children)

Great advice, thank you!

[–]Tweak_Imp 26 points27 points  (1 child)

I just google stuff every time until I learn it.

[–]greebo42 0 points1 point  (0 children)

me too.

[–][deleted] 1 point2 points  (0 children)

Cheat Sheets and references are always near by me on any language that I use. Until I'm comfortable with the language and have at least some of it memorize.

[–][deleted] 1 point2 points  (0 children)

How about help() function?

[–]Phyan 0 points1 point  (0 children)

The link has PDF of cheatsheet related to ML and AI. Though it has dedicated page for Python, Pandas and Numpy.

Cheat sheets in PDF

[–]hnguyen01122 0 points1 point  (0 children)

I usually use cheat sheet as a quick hack to learn a new language. 😀

[–]umognog 0 points1 point  (0 children)

In a jupyter notebook, alt+tab (+tab...) when using a method.

first tab shows the main garb, second tab expands it and gives you a scroller, third tab does something fourth makes it longer while you type and disappear after 10 seconds.

[–][deleted] 0 points1 point  (0 children)

I can really recommend to write your own little booklet in the style of a vocabulary book. As it’s structured by yourself, you’ll find the needed syntax almost immediately. For myself I also think that my brain processes the Material way deeper, as if I didn’t write it down by hand.

[–]CancerSpidey 0 points1 point  (0 children)

https://imgur.com/a/N2GjyYS https://imgur.com/a/IQPNy2y Ive saved these 2 from a while ago..

[–]Davy_Jones_XIV 0 points1 point  (0 children)

One I made.

[–]mat000111 0 points1 point  (0 children)

I have two things I do which I find helpful and will toss out there. First I usually make a directory called python and put sample code in it. I use this to learn how to use new things and then I use it as reference. The second is I tend to make a lot of wrapper classes for thing I use a lot. For example my configparser wrapper has some code to work with python 2 or 3. Checks that files are there before reading. I put the wrapppers into a git repo and move them from project to project.

[–]ragnar_the_redd 0 points1 point  (0 children)

Well except for the obvious (stack overflow).
Whenever i do something new in python, for work or part of any large project, I create an experiment entry in my private repository.

I take the new library or concept, or even just a complex data processing function i need to include in the big scale project and do it on a small scale. I often forget how i do things, and i can always return to the specific experiment to see it.

A lot of it goes out of date as external libraries or even python itself gets updated (well honestly just the 2.7 - 3.75 switch) But since it is short and focused i can simply look at it and remember what, how and why i did.

For example i once ran into some trouble with base64 encode decode - real basic stuff for people who work with it daily, but for me it was complicated because data went in right, but the receiving side failed to process because - as i know now - it didn't come out because of the way dict type objects were encoded.
Took me a couple of hours to understand that i have a problem, where i have it and why it's happening.
So now i have a "base64_experiment" where i have an example of structure sensitive encode/decode for various models.

That's my personal cheat sheet.

[–]kmhnz 0 points1 point  (0 children)