Python Newbie

Discussion in 'Programming & Software Development' started by sic_vl2000, May 7, 2016.

  1. sic_vl2000

    sic_vl2000 Member

    Joined:
    Dec 13, 2004
    Messages:
    985
    Hey, I'm looking to get into some basic programming. From what I've read python seems to be better for beginners. I've tried codeacademy but it's just reading on a screen, udemy the guy teaching I find annoying. Can someone recommend a alternate source for learning?
     
  2. BurningFeetMan

    BurningFeetMan Member

    Joined:
    Apr 22, 2003
    Messages:
    9,495
    Location:
    Veg City
    Same questions here. I've slowly chopped through Python on Code Academy, but compared to some books on BASIC that I've read in the past, Code Academy simply doesn't satisfy.

    Subscribed!
     
  3. OP
    OP
    sic_vl2000

    sic_vl2000 Member

    Joined:
    Dec 13, 2004
    Messages:
    985
  4. bl4ck32

    bl4ck32 Member

    Joined:
    Aug 3, 2005
    Messages:
    4,522
    Location:
    local
    new to programming?

    Id recommend watching these and reading the guys book also :



    I wish someone had shown me these and I had read this guys book to start with before trying to jump into programming. From here any book would be good.
     
  5. deepspring

    deepspring Member

    Joined:
    Jul 8, 2002
    Messages:
    3,601
    Location:
    Maitland, NSW
    Google "Dive Into Python", it's a free online book on Python. Also the video's recommended above a pretty good as well.

    I recommend avoiding ActiveState's python package and instead go for the latest Python.org package instead, alternatively if you want python with an absolute shit load of libraries (mostly math or science related), I recommend the Continuum.io Anaconda build.

    Personally, I recommend setting a project up for yourself and using a combination of Google, Stack Overflow, and Python.org to get you started. I found this is by far the best way to learn most languages.

    Edit: links for the lazy...

    Dive Into Python 3 -> http://www.diveintopython3.net/
    Official Python 3 Download -> https://www.python.org/downloads/
    Continuum Anaconda -> https://www.continuum.io/
    Google -> https://www.google.com.au/
    Stack Overflow -> https://stackoverflow.com/
    Official Python Documentation -> https://www.python.org/doc/

    Edit: I forgot to mention that it's probably a good idea to get a decent programmers text editor, personally I recommend Atom.io. But Notepad++ is a decent lightweight alternative too.

    Atom Text Editor -> https://atom.io/
    Notepad++ -> https://notepad-plus-plus.org/

    I also recommend learning about Git and version management before you set about learning python. Here are some free resources:

    GitHub -> http://github.com (free until you want a private repository for your code)
    GitHub Tutorial -> https://try.github.io/levels/1/challenges/1
    Tower-Git Online Learning -> https://www.git-tower.com/learn/
    Git for Windows (Command line) -> https://git-scm.com/download/win
    GitKraken GUI Client -> https://www.gitkraken.com/
     
    Last edited: May 8, 2016
  6. doug81

    doug81 Member

    Joined:
    Jul 18, 2005
    Messages:
    4,677
    Location:
    Cambodia
    Last edited: May 9, 2016
  7. Sindarin Ultra

    Sindarin Ultra Member

    Joined:
    Sep 7, 2005
    Messages:
    250
    Location:
    Brisbane
    lol, seriously?

    That's putting the cart before the horse surely.

    Just get a simple text editor with syntax highlighting e.g. Notepad++ on Windows, and follow one of the many book/courses out there (e.g. check out the sidebar at r/Python). That's it to get going and simple enough to switch if you don't like someone's teaching style - there are hundreds out there.
     
  8. deepspring

    deepspring Member

    Joined:
    Jul 8, 2002
    Messages:
    3,601
    Location:
    Maitland, NSW
    Sorry. I'm told it's called tongue-in-cheek humor. I guess that sense of humor doesn't apply real well on written forums.

    Learning Git is extremely easy and is well worth it, especially for a beginner. If he learns version control (Git, Subversion, Mercurial, or even Bazaar) before he gets embedded in coding, he will be miles ahead of the typical newbie.
     
  9. chewbacca

    chewbacca Member

    Joined:
    Jun 28, 2001
    Messages:
    954
    Location:
    Sydney
    I found Coursera was quite good. It's free and has some structure via weekly video lectures and exercises if that's your preferred learning method.

    https://www.coursera.org/learn/python/
     
  10. myeewyee

    myeewyee Member

    Joined:
    Apr 24, 2008
    Messages:
    404
    Location:
    Sydney
    Do you have any specific problems you want to be able to solve using programming? That for me was a key driver when I started learning late last year - I wanted to write an app to find cheap phones on ebay.

    I found that motivating force + lots of googling + stack overflow to be much more effective than following a set course.

    I started CS50 on edX and found it interesting, but without a specific goal in mind I wasn't motivated enough to complete it.
     
  11. elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    44,056
    Location:
    Brisbane
  12. OP
    OP
    sic_vl2000

    sic_vl2000 Member

    Joined:
    Dec 13, 2004
    Messages:
    985
    I don't have specific problems, but I do have tasks at work that I would like to try to automate via programming.
     
  13. deepspring

    deepspring Member

    Joined:
    Jul 8, 2002
    Messages:
    3,601
    Location:
    Maitland, NSW
    Close enough.

    If you don't mind us asking, what kind of tasks?

    Python is an excellent language, but sometimes some other language might be a better fit, especially on Windows (i.e., Powershell.)
     
  14. w0ng

    w0ng Member

    Joined:
    Dec 17, 2006
    Messages:
    126
    Location:
    Sydney
    Except it's not.

    I'm actually in favour of learning git with a decent gui such as SourceTree before writing your first program (excluding online lessons/tutorials/books). With code from lessons/tutorials/books, you know where to look up when you forget why or how something works. With code that you write, especially while learning, you don't. By learning git and writing good commit messages, you can track changes based on new stuff you're learning, even if you have well commented code.

    e.g. Imagine your first program you'll write is "The factorial of 10", say factorial.py.

    Without git, you might be tracking your changes by using multiple files a la how we manage our *.doc files.

    factorial_v1.py
    Code:
    #!/usr/bin/env python3
    # Print the factorial of 10 by straight up multiplication
    print(10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1)
    factorial_v2.py
    Code:
    #!/usr/bin/env python3
    # Print the factorial of 10 by using a while loop
    number = 10
    factorial = number
    while number > 1:
        factorial = factorial * number
        number = number - 1
    print(factorial)
    factorial_final.py
    Code:
    #!/usr/bin/env python3
    # Print the factorial of 10 by using a for loop
    number = 10
    factorial = number
    for i in range(1, number):
        factorial *= i
    print(factorial)
    
    factorial_final_lol_srsly_last_one_this_time.py
    Code:
    #!/usr/bin/env python3
    # Print the factorial of 10 by using a recursive function.
    def factorial(number):
        if number == 1:
            return number
        return number * factorial(number - 1)
    print(factorial(10))
    
    Alternatively, without git, you might be tracking changes by commenting them out in a single file:

    factorial.py
    Code:
    #!/usr/bin/env python3
    ## Print the factorial of 10 by straight up multiplication.  Changed at 20 May 2016 8:00PM.
    #print(10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1)
    #
    ## Print the factorial of 10 by using a while loop. Changed at 21 May 2016 7:30AM.
    #number = 10
    #factorial = number
    #while number > 1:
    #    factorial = factorial * number
    #    number = number - 1
    #print(factorial)
    #
    ## Print the factorial of 10 by using a for loop. Changed at 21 May 2016 12:00PM.
    #number = 10
    #factorial = number
    #for i in range(1, number):
    #    factorial *= i
    #print(factorial)
    
    # Print the factorial of 10 by using a recursive function. Changed at 23 May 2016 5:00PM.
    def factorial(number):
        if number == 1:
            return number
        return number * factorial(number - 1)
    print(factorial(10))
    Using git alleviates this problem. You only ever code from your latest change. A log shows the changes. Green means lines added. Red means lines removed. The messages you type when updating explains why lines were added/removed. It makes learning to code extremely easier by being able to trace the steps that got you to the final result, imho.
     
  15. BurningFeetMan

    BurningFeetMan Member

    Joined:
    Apr 22, 2003
    Messages:
    9,495
    Location:
    Veg City
    Subscribed to his stuff. Brilliant. Thanks!
     
  16. OP
    OP
    sic_vl2000

    sic_vl2000 Member

    Joined:
    Dec 13, 2004
    Messages:
    985
    I should really get stuck into Powershell, I'm doing a fair bit with SCCM at the moment so SQL ties in as well.

    I have access to Git at work, work dev guys use it. I should hassle them but they have priorities at the moment.
     
  17. deepspring

    deepspring Member

    Joined:
    Jul 8, 2002
    Messages:
    3,601
    Location:
    Maitland, NSW
    It would make sense.
     
  18. OP
    OP
    sic_vl2000

    sic_vl2000 Member

    Joined:
    Dec 13, 2004
    Messages:
    985
    Sooo many things going through my head though SCCM, want to learn some programming to help decipher tasks that come through before escalating to dev guys. Guess, I probably shouldn't want to take so much on lol.
     
  19. deepspring

    deepspring Member

    Joined:
    Jul 8, 2002
    Messages:
    3,601
    Location:
    Maitland, NSW
    Well that's the neat thing about coding, it helps you think abstractly about the tasks your trying to achieve by giving you a method of breaking it down into smaller and smaller chunks of code.

    I'll be the first to admit that I know nothing about SCCM (except what it stands for), but given the tasks you are likely to need to do in it, it only seems right to recommend learning Powershell instead of Python... Mainly because it exists on all Windows 8+/Server 2012 systems.
     
  20. mcfee03

    mcfee03 Member

    Joined:
    Jan 28, 2007
    Messages:
    835
    Location:
    Sydney
    iPython is a really handy command line tool to use. It lets you write/test python pretty easily on the go.

    Good luck!
     

Share This Page

Advertisement: