Results 1 to 6 of 6

Thread: Learning Python -- Favorite Resources?

  1. #1

    Default Learning Python -- Favorite Resources?

    I'm learning Python via some Code Academy stuff. It's okay, sometimes I feel like I'm making progress and other times I feel like I'm going through some type of game that has no ending.

    Anyone have any other preferred resources to learn? How do you learn these things in general? I used to be good at this stuff, but now my brain is mush.

  2. #2
    I've written and used python a little bit, though just with some reference materials and general programming principles. I wouldn't say I 'know' it, though.

    Question: why are you learning python? Is it just some general self improvement thing, or do you have a specific task in mind? Is it your first programming language?

    In general, I would decide on the thing I'm going to do, then try and do it in the new language. And time I don't know how to do a thing in the new language (example: what is the syntax for xyz), I google how to do it. When I come across concepts or terminology I'm unfamiliar with I try and find a good resource which explains the theory behind it, until I understand [thing] well enough to use [thing] in any given context, not just the problem I'm currently working on. I generally find that a very good use of my time. It's very important to have a good mental model of what each and every line is actually doing, otherwise when things don't work it's basically guess work trying to figure out why and you'll tear your fucking hair out.
    When the sky above us fell
    We descended into hell
    Into kingdom come

  3. #3
    I don't have specific resources to help you - I've dabbled in Python but do most of my pseudo-coding in Matlab and R. The nice thing about Python is that there's a lot of documentation and support out there, so figuring out straightforward syntax issues should be straightforward. I'd say my best general suggestion for really learning how to code it to look at other people's code that does something similar to what you want to do. It really helps to work through a moderately complex program and figure out how they did what they did and why - it also will teach you a lot of programming best practices if you choose your code well.
    "When I meet God, I am going to ask him two questions: Why relativity? And why turbulence? I really believe he will have an answer for the first." - Werner Heisenberg (maybe)

  4. #4
    Well, writing python is my day-job so my advice will either be very good or completely useless.


    So, I poked the code academy stuff, I can see how it seems... monotonous. My real advice is the same as steely's "Find something you want to do and do it". I think he went over the basics pretty well, so I'm going to be a little more technical:


    First off:
    https://www.python.org/downloads/


    I used to strongly suggest using Python2, but Python3 has now matured to the point where I consider it good for starting off. The key is to pick one version and stick with it! Mixing python versions = "here be dragons". Download it, install it. When going through the installer there's a step where you select waht parts you want to install, make sure you _enable_ the option to add python to PATH. This will save you _lots_ of headaches later on.


    To ensure everything is working, open a command prompt (Start>Run then type "cmd" and enter) and type : "python" then press enter, you should see a '>>>' prompt, and be able to type in arbitrary python code similar to on the code academpy prompy. Use CTRL+C to exit this, then type "pip list" and you should get a short (possibly one item) list of packages currently installed. If pip _doesnt_ work then right click the below link, save it in your C:/Users/Dreadnaught and type "python get-pip.py" then try again, it should now work.


    https://bootstrap.pypa.io/get-pip.py


    With all that done you are ready to write python programs on your own computer by putting python code inside a ".py" file. Use google to help you solve problems, expect many answers from StackOverflow. sometimes the results will recommend installing a package to do something, this is what pip is for: open the command prompt again and type "pip install <package_name>" and then continue on. Unfortunately, some things (numpy is a big culprit) just wont install properly on windows, there are ways to get them to install but they are long and complex.


    Now go find something you want to do then do it!

    (Also, I heard this book is decent, though have not read it myself: https://automatetheboringstuff.com/ )


    ---

    Edit: Actually, the book above is pretty good. I just used it for the first time to throw out a little script to help me find an office chair. I've made a gist as an example, it should be small enough to figure out how it works and build from there, as well as showing what is possible:
    https://gist.github.com/zchfvy/db931...9a43ced77862b1

    Credentials blanked out with the XXXs of course! And it uses 'twilio' beautifulsoup4' and 'requests' packages installed from pip.
    Last edited by Cracky; 02-25-2017 at 11:09 PM.

  5. #5
    Quote Originally Posted by Steely Glint View Post
    Question: why are you learning python? Is it just some general self improvement thing, or do you have a specific task in mind? Is it your first programming language?

    Quote Originally Posted by Cracky View Post
    Well, writing python is my day-job so my advice will either be very good or completely useless.

    So, I poked the code academy stuff, I can see how it seems... monotonous. My real advice is the same as steely's "Find something you want to do and do it". I think he went over the basics pretty well, so I'm going to be a little more technical:
    You two have been blinded by your experience and knowledge, and clearly have no idea what to do on these subjects

    Thank you. I think you bring up a good point, which is WTF am I doing? This is mostly general knowledge-increase, however I see a time when my professional life will benefit from having some base-level knowledge here. That said, I am a total novice in this area. I was good at messing with things in the late 90s but tried/failed to learn Visual Basic and never did this stuff again. The Code Academy is monotonous but I suspect I need that, because my pool of base level knowledge has drained to become shallower than a bird bath.

    That said, I am a more practically oriented person which is why I spend my days exporting capitalism to backwards places. In that world of brute-force sensibility, Automate Everything looks AWESOME. I might just trudge through the Code Academy stuff and then look to that book.

    Do folks tend to buy the books or view digitally? Part of me wants the physical book, even though I've made a goal of owning no physical books and can't imagine a life without Ctrl + F.

  6. #6
    Quote Originally Posted by Dreadnaught View Post
    You two have been blinded by your experience and knowledge, and clearly have no idea what to do on these subjects

    Thank you. I think you bring up a good point, which is WTF am I doing? This is mostly general knowledge-increase, however I see a time when my professional life will benefit from having some base-level knowledge here. That said, I am a total novice in this area. I was good at messing with things in the late 90s but tried/failed to learn Visual Basic and never did this stuff again. The Code Academy is monotonous but I suspect I need that, because my pool of base level knowledge has drained to become shallower than a bird bath
    If you're starting as a rank beginner, you might want to consider some general 'introduction to programming' type courses first, I don't know what level the Code Academy stuff is at.
    When the sky above us fell
    We descended into hell
    Into kingdom come

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •