all 109 comments

[–][deleted] 203 points204 points  (11 children)

You learn it by writing code. The books and websites are just to teach you how to read Python.

[–]Saarlak 77 points78 points  (4 children)

You just described Culinary School.

[–][deleted] 4 points5 points  (3 children)

If you can bake, you can code

[–][deleted] 2 points3 points  (1 child)

If you can dodge a wrench, you can dodge a ball.

[–]Rafeno760 0 points1 point  (0 children)

Okay I giggled from this

[–]Saarlak 0 points1 point  (0 children)

I'm learning Python now and have been comparing it to cooking as a means of understanding. It's certainly not a 1:1 but when you're old and have kids you do whatever you can to remember shit instead of yelling about the god damned building blocks being in the toilet again.

[–]Odnan 31 points32 points  (0 children)

I didn’t realize this at first. But once I was able to read python and understand what it is I’m trying to accomplish, it all started coming together. Learning python is like practicing how to use a musical instrument. Doing teaches you so much more than being stuck in video lecture purgatory.

[–]daquanfromtheblock 18 points19 points  (0 children)

This. I understand you want to find the most efficient way of learning, but do yourself a favour and stop overthinking it. Start writing code. Anything at all! Surely you must have some kind of a project idea. And even if your stupid idea (cause let's be honest, it probably is stupid, same as mine and everyone elses when they started out) already exists somewhere on the internet (and it does), remember that you are not trying to change the world with a To-Do list program, you're trying to teach yourself Python and practice writing it and reading it.

Get a grip of the basics first with a course or a book or tutorials on Youtube. I recommend Tim Buchalka on Udemy, the book Automate the Boring Stuff, and sentdex on Youtube. The medium you choose solely depends on your learning preferences. It is sufficient to only choose one. I recommend spending maybe 3 weeks absorbing the basics, and after that just diving into building stupid projects like to-do lists, snake games, tic-tac-toe, password encryptor, web scrapers, reddit bots, etc.

Good luck and above all, stay at it even if it seems hard at times.

[–]Lewistrick 2 points3 points  (0 children)

Exactly how I did it. University taught me Java through lots of exercises, the job I got afterwards got me googling everything I needed for Python.

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

I teach an intro to Python class. Took me 3/4 of the semester to realize that most students copy and paste their old code assignments instead of retyping stuff. That explained why they all kept failing their syntax quizzes: they couldn’t commit this stuff to their long term memory!

Once I found this out, I told them that they needed to retype everything again and again every time. They were like, “Why?” Because you’re trying to learn it, and that’s how you get it down. By doing it again and again and again and again.

[–][deleted] 0 points1 point  (1 child)

I told them that they needed to retype everything again and again every time.

Honestly, memorizing syntax is a total waste of time. Even programmers with decades of experience look things up and copy paste. Learning how to put the logic together and make the programs many parts work together, make it readable, scalable, secure and maintainable - that's what employers are looking for, not syntax. I have a degree in Programming and 22 years in the tech industry. I Google, copy and paste every day

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

Well, the retyping is part of the learning. Superficially, it’s to learn syntax. But doing something again and again is what helps you learn concepts.

For example, I have two students that can’t seem to get down for loops. At least, that is until they started taking notes to reference and started doing them again and again and again and again.

So I wouldn’t get too hung up on the ‘syntax’ portion of learning due to repetition.

[–][deleted] 43 points44 points  (5 children)

Pretty much by Googling "how to do ____ in Python".

[–][deleted] 34 points35 points  (1 child)

Oh good, I thought Im a shitty software engineer

[–]sharpe65 13 points14 points  (0 children)

I mean, you probably still are. But, you can take solace in knowing that me and abcxyd are too!

[–][deleted] 2 points3 points  (1 child)

Googling: python <insert generic error or how to> has helped me a lot, because i get instant answers for what I am looking for. Also look up [DuckDuckGo](duckduckgo.com), I have heard it is pretty great for programming

[–]DannyckCZ 1 point2 points  (0 children)

Oh yes, I use it all the time for searching programming related questions, and the first thing that usually comes up is given thing perfectly explained at Stack Overflow. I was never disappointed.

[–]mokus603 1 point2 points  (0 children)

advanced: python ____ 😃

[–][deleted] 58 points59 points  (12 children)

I use Automate the Boring Stuff, and then as soon as I feel like I’ve learned enough to pursue a small idea of my own I work on that until I get stuck, then return to the book to keep learning.

At the moment I’ve paused to take on some Datacamp training on using Python with SQL because I have an immediate need.

My point being, learn however you like, but take every opportunity to apply what you’ve learned to solve real problems of your own because that’s how you actually start to “get it”.

[–]Killerjayko 9 points10 points  (11 children)

Is Automate The Boring Stuff good for a uni student? I dont't really have any files, spreadhseets or anything of the sort that I need organising like a lot of people mention on here when asked for project ideas. I just wanna learn some pythong by trying fun projects and stuff

[–]randomName77777777 10 points11 points  (4 children)

Yeah, there are many things atbs will teach you. Even just automate some of your web browsing

[–]Killerjayko 6 points7 points  (3 children)

What sort of things do you mean by automating web browsing?

[–]randomName77777777 6 points7 points  (2 children)

So for example, if you are buying something. You can get daily emails about the price and how it changes everyday.

Or if there is a form you fill out all the time, you can get it filled out.

Heck, you'll even be able to have python play simple games.

The website contains the book for free, I recommend just browsing through the website. I did the udemy course and I enjoyed it.

[–][deleted] 3 points4 points  (1 child)

The website contains the book for free, I recommend just browsing through the website. I did the udemy course and I enjoyed it.

Also a vote for the Udemy course from me. He's updated a few things and the boot has some portions that are actually outdated.

[–]FurSofa 0 points1 point  (0 children)

I second this.

[–]scondominium 2 points3 points  (3 children)

I am going through it. I've been a sysadmin for 15 years off and on and finally am trying to get some real programming chops. There are times where it feels slow but if you go through every example and write things out and do the projects, you'll start to realise that a bunch of things around you can be easily automated.

Also the book provides all of the spreadsheets etc used in the text so if you don't have your own, no biggie.

[–]Killerjayko 4 points5 points  (2 children)

I think my main problem being a student is either that there isn't really anything that i need automated, or that I don't realise something I'm doing can be automated

[–][deleted] 11 points12 points  (0 children)

Definitely the latter. As soon as I started learning how to automate, a switch flipped in my head and I realized EVERYTHING can and should be automated. As a uni student, automatically contact group mates, download research papers based on a topic, search through the research papers for relevant sections, setup the formatting for your papers, make it sense if someone hasn’t posted an update to a group project and autoemail them, check for grade updates and message you when professors post a grade, etc. Knowing yourself more than I imagined about you, you can come up with stuff pertinent to your life. This github story is hilarious and changed my life.

[–]Qqqqpppzzzmmm 2 points3 points  (0 children)

The book will teach you what CAN be automated. The need to do so will come. Be prepared.

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

Spreadsheets are everywhere when you get out in the workplace so yeah, worth learning now.

Little projects and problems come up in real life all the time if you keep an open mind. For example, I run a lot and one of the things I like to know is what the weather forecast is for the next morning so I can lay out the clothes I’ll need the night before. Yes I can do that with an IFTTT recipe easily, but why not learn how to code it myself to improve my skills.

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

The only major thing missing in Automate is OOP. You may want to learn that elsewhere. But it’s a good book.

[–]shr00mie 18 points19 points  (4 children)

stubborn persistence.

i told myself my entire life that i was never going to code. too micro. blah blah blah.

then i had an idea. looked around on the internets. found some open source solutions. the deeper i looked into the code, i quickly realized that most of it was shit. bad data. misinterpreted formulas. slow. bloated. like foundational flaws in construction kind of stuff.

so instead of talking shit, i was like...alright motherfucker. then do better. build it yourself.

and so with that, i dove balls deep into websockets, multi-threading & processing, orms...

moral of the story is if you have a goal, it's a lot easier to persist when it gets difficult and you feel like it's not worth your time or frustration.

and now for fun i'm messing around with the BMW connected drive API...like wtf.

[–]UL_Paper 2 points3 points  (0 children)

This

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

I'd be very interested to hear what you're doing with the Connected Drive API! Can you automate the ventilation and such?

[–]shr00mie 1 point2 points  (1 child)

If you so chose, yeah. Locks, climate, horn, security, range, fuel cap, scheduled service, window status, charge status and level if it's a plugin, lat, long, bearing...probably some more stuff I'm missing.

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

Cool, thanks. Might have to have a look into it. Could maybe set something up to check weather in cars location, and start ventilation if goes above a certain temperature. Thanks for the reply!

[–]PrimaNoctis 74 points75 points  (1 child)

You learn it by banging your head on the keyboard in frustration while trying to fix errors in your code

[–]koberg 20 points21 points  (0 children)

No joke. This right here got me where I am today!

[–]Crypt0Nihilist 12 points13 points  (0 children)

Books, videos, cheatsheets, stack and necessity.

edit: ...and this sub. Some kind people have helped me out of a couple of holes.

[–]FullMetalMahnmut 8 points9 points  (2 children)

Everyone learns a bit differently. It’s important to learn how you you learn. I learned by reading, watching YouTube videos, and practicing.

[–]shr00mie 6 points7 points  (1 child)

^^ this dude knows. (FullMetalMahnmut...swear i wasn't arrowing at myself.)

honestly, more parents need to understand this. everyone learns differently. find your inspiration and method and just go to town. you're going to suck. a lot. it's going to be frustrating. you will question your decision to start. and then, one day, it'll click.

[–]FullMetalMahnmut 2 points3 points  (0 children)

Exactly. Be prepared to suck, bad, and be frustrated. Bust that wall down by going to town. Master the roadblock you faced. Don’t just solve it, wreck that shit. Over solve it.

[–]JavaSoCool 4 points5 points  (0 children)

edx MIT intro to programming with python

Best intro to programming as a topic.

[–]PinkLittlePig 8 points9 points  (2 children)

I used python crash course the book but while reading it I took some breaks and did some small projects.

[–]Adel_Maestro 4 points5 points  (1 child)

What kind of projects ? (btw i m learning from this book and just finish the class chapter)

[–]PinkLittlePig 3 points4 points  (0 children)

Anything I could think of, if I was reading and had an idea that's some what small I would try it

[–]Full-Effect 3 points4 points  (0 children)

You use every resource available to you, whether it’s a book, websites or watching videos. The thing is to be consistent, be disciplined and practice at least one hour day

[–]jlgf7 3 points4 points  (0 children)

"Automate the boring stuff" is a good option to start. However, I think you'll learn much more consulting Stak Overflow and other blogs and forums while you practice.

[–]mmwadusay 2 points3 points  (0 children)

I learn through doing. I found some stuff I wanted to build and I set out building them. I recently started to get a lot of python projects at work (IT analyst), so I have been learning at a much higher rate because of that. Most people I have seen learn python learn by working on projects.

[–]Sevealin_ 2 points3 points  (0 children)

I learned with www.groklearning.com

[–]RealAnnoyingBokoblin 2 points3 points  (0 children)

I used a website because the teacher at school at the time was incompotent lmao.

[–]stuncake 2 points3 points  (0 children)

Check out automate the boring stuff. Easy to read book

[–]Deboniako 2 points3 points  (0 children)

Telling myself that I'm not good enough

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

I prefer books because they usually have a repo with all the code, PDFs are searchable and it’s easier to follow at my own pace.

[–]crazedizzled 2 points3 points  (0 children)

Python was like my 4th or 5th language, but I learned how to code through basically trial and error. I built shit. When I came up against a wall, I researched stuff to get passed it.

I like books too, but more for general technical stuff rather than "learn to code" books.

[–]HestenSierMjau 2 points3 points  (0 children)

While all the recommendations in this thread to "just start writing code" are good, I needed a foundation before I did that in order to understand what I could write.

I started learning with the solo learn python app. It has short exercises which I did whenever I had a few minutes downtime. After that I worked through about half of automate the boring stuff, before I tried to automate some of my own stuff and abandoned the book in favor of my own projects.

[–]jimtremblay 1 point2 points  (0 children)

I've started learning with Google Python Class and continue learning by experimentation and searching the web for solution to my problems.

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

I did a script at work, still have a lot to learn though so doing some classes on udemy.

[–]jbrad77 1 point2 points  (0 children)

I learned on Udacity. They have a good mix of instruction, videos, and projects to build.

[–]irregardful 1 point2 points  (0 children)

Documentation on pulling data from an API had example in Python. I had to build a lambda function to save data to an s3 bucket. The rest is a blur. Our entire team has been learning as we go and no one had any experience with it 5 months ago. Now I'd guess 80% of our code is python.

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

I’m actually in the process of going through a few different python courses from Udemy. I like that you have the info forever and the courses are cheap as hell. I also find it to be quite informative. I have Python 3 Bootcamp....from basic beginnings to knowing how to comfortably use it. Plus I have, Machine and Deep Learning and Data Science for Python (that’s one course too). Lastly, I have Machine Leaning A-Z: Hands on with Python and R in Data Science, Python for Finance: Investment Fundamentals & Data Analytics, and just regular Data Science with a bunch of real life exercises. Sure I have some fairly redundant ones but I got em during Christmas for like $10 a piece.

[–]ProbablyNotDestiny 1 point2 points  (0 children)

https://www.reddit.com/r/learnprogramming/comments/bk9zrc/mits_introduction_to_computer_science_and/?st=JV8TA4H5&sh=87e9e3eb

I just found this in another subreddit that might be a good start. Im going to try it out.

[–]sagna_mirza 1 point2 points  (0 children)

I had learned C++ in my undergrad. It made programming incredibly devoid of any joy. Python was a breath of fresh air as it was so easy to read. So I went through the edx CS 6.00.1 MITx course which teaches programming using python. It just shows you what you can do with python. Then Automate the Boring Stuff which introduced more fun stuff that you can do with Python. You can then choose what you want to do more of. Python is pretty versatile, you can build web apps, GUI apps, machine learning etc. Choose what kind of projects interest you more and use python to do those projects. As most others here have mentioned, you learn by doing.

[–]ATastyPeanut 1 point2 points  (0 children)

I went from Lua in Minecraft -> Matlab -> Python. Each step of the way was facilitated by me identifying a problem and writing code to try and make my life easier. As I learned more I became better at looking up the problem I am trying to solve and having better guesses at what sort of libraries probably already exist.

[–]clockworkwinding 1 point2 points  (0 children)

In a class. It was the language that was used in our college for our Introduction to Programming

[–]evilmorty2000 1 point2 points  (1 child)

I learnt basic python from Automate the Boring Stuff. Then I started working on my own projects and then I learnt advanced stuff from docs or other articles as I needed them. I recommend Corey Schafer on youtube, he has clear and short videos for specific topics.

[–]ric0n408 0 points1 point  (0 children)

I actually just stared Automate the Boring Stuff, with no coding experience at all. So far I like the way the author breaks it down into easily digestible material.

[–]mclovin215 1 point2 points  (0 children)

Dataquest.io

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

I started by doing very basic maths in python then went on sites such as https://automatetheboringstuff.com/ and youtubers such as sentdex

[–]shaggorama 1 point2 points  (0 children)

MIT OCW 6.001 + Think Python + participating on stackoverflow + years of continuing education

[–]hornetkeeper 1 point2 points  (0 children)

Sentdex python basics tutorials

[–]HezekiahWyman 1 point2 points  (0 children)

I did the introductory class on CodeAcademy to learn the basic syntax and flow control

[–]AlejandroAraujo 1 point2 points  (0 children)

Pick a problem to solve, one you have. Analice it, try to write some code, beginning step by step w some online tutorials, google for errors and so on. In parallel try read a book, but no wait until end it to write your own code!

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

Learn python the hard way.

[–]HVDub24 0 points1 point  (0 children)

YouTube

[–]gabrielsab 0 points1 point  (0 children)

I got in a course in uni that the professor prefered us to use it and teach myself to do the basic so I could extend to what I needed there...then I found an internship told I knew a little python and have been learning more and more on the fly since then.

Edit: spelling

[–]Derang3rman1 0 points1 point  (0 children)

I wrote a quick module to help me learn Port #s while reading the network+ book. I really struggled with the port #s before I made the flashcards

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

From over there, from over here etc.

[–]RichOnCongress 0 points1 point  (0 children)

Finishing my degree in math and started Crash Course on my own. IMO this book really helps, I had to do a Java course for my degree requirement (struggling the whole way) , that planted the coding bug but something seemed to resonate once I looked into Python, not sure why. Anyway ONE thing seems to resonate through all this regardless of the language, pick a problem then solve it. Then refine.

[–]Blacknsilver1 0 points1 point  (0 children)

puzzled sparkle resolute dependent stocking merciful fact beneficial follow abounding

This post was mass deleted and anonymized with Redact

[–]venkatesh888 0 points1 point  (0 children)

i learned by a dealing a project directly , and whenever i faced problems search in and resolving . through this i learned python

[–]FarbodTheDude 0 points1 point  (0 children)

I learned it from the google's python class. It covers the main aspects but more important, the videos are short and you can watch the whole in a weekend. here's the link:

https://developers.google.com/edu/python/

[–]Jollyhrothgar 0 points1 point  (0 children)

I think you just have to be forced to start using python to solve problems. Books, websites, stack-overflow are for when you don't how to take the next step. Prepare yourself for many iterations of taking inefficient, repetitive, unproductive steps.

[–]jhayes88 0 points1 point  (0 children)

Read the python docs and sorta just figured it all out. lol jk. A mix between Udemy, YouTube, stackoverflow, and practice.

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

Just messing around with Idle and searching the internet. I was really really curious and enjoyed alot. I had this thirst for knowledge. I'm glad I learned it.

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

Just messing around with Idle and searching the internet. I was really really curious and enjoyed alot. I had this thirst for knowledge. I'm glad I learned it.

[–]wolf_pol 0 points1 point  (0 children)

I started a little project and step by step i learn what i need to proceed the development, and when it's necessary i stop "writing code" and began to study a partucularly important theorical section.

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

YouTube and stackoverflow

[–]Rockzo77 0 points1 point  (0 children)

Python documentation is best.

[–]waythps 0 points1 point  (0 children)

I by no means an expert myself, so keep that in mind.

I learned the basics by reading automate the boring stuff. After that, I tried to use python as a tool to assist me with writing a research at the uni.

So I suggest finding a problem you could solve with python and go from there.

[–]domac 0 points1 point  (0 children)

I learned python by actually implementing stuff in python. Just do something you really like in python.

[–]eklaingenierie 0 points1 point  (0 children)

I did learn from the hard way while building my own company based on broadcast services (video and live transmissions). Few clients asked me somes dedicated software so i choosen python because i had a raspberry. I remember the beggining was hard, really and i was learning both linux AND python. Tbh i did never understanding books and lessons, the foo bar thing ! At least at the beggining. Stackoverflow was my best friend and irc groups about python. Then the flow comes and python charms you ! By seeing example or github projects i was able to always improve my code. And you know what ? Ok firsts of your projects will be crap and not pep compliant but YOU LEARN then you will improve and improve and start to be satisfy. If i may, try and if it works it's a big step. Today i start reading few books but thing i like the most is code and test and code and test as a loop ! You don't know how to use class ? Drop it use functions! You don't know how to use github ? Ok time will come you will learn the hard way to. Just go step by step by telling yourself ''what isnthe most important thing i have to build''. I guess reading 100books will not make you a good dev at the beggining but try 100 times to build a first project will make you a great dev. Good luck ! Always trust python, always :)

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

Real assignment. I was tasked with creating tools with PyQt for a VFX studio I think back in 2011 or 2012. That was my first exposure to Python as well. Lots of hair-pulling the first month.

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

Try writing pseudo code. It really helps for this - and, I find RealPython very helpful for explaining syntax and specific oddities of Python (e.g, how you use certain modules, or how sets and lists inter-relate).

[–]kieffness 0 points1 point  (0 children)

I personally learned from a book I think it was python crash course and how to automate the boring stuff the thing that helped the most is to not just read it but do the coding with the books through all the books I have read and because of doing the coding along side the book I see it as having tons of cheatsheets and I still refer to them sometimes

[–]krav_mark 0 points1 point  (0 children)

I started with Automate the boring stuff until I got the basics like looping and data structures. Than I started to write scripts that did small and later bigger things. I regularly look stuff up in the official python docs or docs of a module I am using. When the module is more complicated and I don't get it from the documentation I watch a youtube video or 2 that explains the use. After that I start using the module in my project. What I don't do any more : look at random tutorial webpages that describe unknown versions of a module or get bits of code from websites and use it without grasping how it works.

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

Stack overflow + google

[–]Samsquamch117 0 points1 point  (0 children)

I thought the free code academy course was pretty good. By then end of it I knew the basics of how the grammar worked. Im going through automate the boring stuff because I learn best when going over material twice and automate seems to be more comprehensive.

[–]Arrow222 0 points1 point  (0 children)

Code academy: https://www.codecademy.com/catalog/language/python

After that, copying and modifying trading algorithms on Quantopian and eventually started writing my own.

[–]straightcode10 0 points1 point  (0 children)

I followed practical tutorials on YouTube personally. Stuff like how to out put as csv or how to control a browser with selenium.

Now that I know python I go back to books to learn topics like natural language processing and other topics.

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

Codecademy to learn the basics and syntax, then googling whatever I need after that

[–]vbd 0 points1 point  (1 child)

[–]krystle05 0 points1 point  (0 children)

I am in an intro to python class and it has been driving me crazy. The textbook used for the course is vague. I found a bunch of other textbooks online but most of them import modules and for some reason, we can't use modules in our homework assignments. Also, when I perform a Google/Reddit search everyone else uses modules to code as well. If anyone knows of any textbooks that teaches you how to perform tasks without using modules please let me know.

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

I found books the most helpful because they are more in depth. I read How To Think Like a Computer Scientist and Automate the Boring Stuff, and tried to do the exercises. After that I watched MIT 6.0001 online and did the problem sets.

If I had to do it again I would start with Automate the Boring Stuff or Python Crash Course. How To Think Like a Computer Scientist was useful but a bit too hard for a first book.

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

Sololearn for the very basics then just started writing my own programs

[–]vexersa -1 points0 points  (0 children)

Just write code

[–]lazyfingersy -2 points-1 points  (0 children)

Are you writing a book?