File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Jython/Python and the fly likes Learning Python Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Jython/Python
Bookmark "Learning Python" Watch "Learning Python" New topic

Learning Python

Daniel Hirning
Ranch Hand

Joined: Sep 16, 2013
Posts: 50

I have the opportunity to learn a bit of Python on the side.

Getting any level of exposure to different programming languages, is obviously a bonus for an aspiring developer.

Will learning some Python be a good use of my time, or should I be looking for a non OO language as I am already immersed in Java?

Any thoughts would be great,

chris webster

Joined: Mar 01, 2009
Posts: 1606

Reasons to learn Python, even if you already know Java?

  • It's much easier to pick up and become productive with than Java.
  • There are masses of great learning materials for Python online and in books etc.
  • It's available on any platform and is widely used e.g. in science and the financial sector.
  • It is widely taught in colleges and elsewhere, so there are plenty of people around who can help you out.
  • It is an immensely flexible and practical language with excellent library support for all kinds of special purposes e.g. scientific programming, machine learning, natural language processing, systems admin, etc.
  • It also has plenty of interesting options for mainstream applications e.g. web apps with Django, good database support, and excellent tools for data analysis, for example.
  • It is also very useful for platform-neutral scripting where Java would be too much bother.
  • It has its own distinctive characteristics compared to Java - e.g. lambdas and comprehensions - that make it an interesting language to learn both in its own right and as a way to broaden your own understanding of programming in general.
  • Why not? It might be fun.

  • How to learn Python?

    Free online courses - with different emphasis - include:

  • Introduction to Computer Science on Udacity.
  • Design of Computer Programs on Udacity.
  • Learn To Program: The Fundamentals on Coursera.
  • Learn To Program: Crafting Quality Code on Coursera.
  • An Introduction to Interactive Programming In Python on Coursera.
  • Google's Python Class as taught to Google recruits.

  • Books:

  • Think Python by Allen Downey, free online book (print edition also available) based on the "How to think like a computer scientist" books.
  • Dive Into Python 3 by Mark Pilgrm, latest free online edition of a classic book on Python programming.
  • Think Stats also by Allen Downey, a free online book using Python to teach statistics.
  • Head First Python by Paul Barry, not free but an excellent rapid introduction to Python programming from the basics to cloud-based web applications with Django and Google App Engine.

  • Tools for learning Python:

    I would probably go for Python v.3 if you're starting from scratch, but Python v.2.x if you need to be sure that other libraries are compatible, as the current version of Python v.3.x is no longer fully backwardly compatible with previous versions. You can of course go hard-core and use nothing but vim/emacs and the command line, but if you prefer a Python-aware editor, there are lots of options, including plugins for common text editors. A couple of other Python IDEs include:

  • PyScripter is a lightweight Python editor for Windows, which is easy to set up and use.
  • Spyder is a handy and relatively lightweight Python IDE with a particular focus on scientific calculation using common Python libraries such as Numpy, Scipy etc.
  • PyDev is a widely used Python plugin for Eclipse, but I tend to use Spyder instead.

  • OK, enough from me. I hope I've encouraged you to take a little time and explore Python for yourself. I'm still new in Python-land, but I really like finding ways to use it, especially after a hard day's grafting on Java EE!

    No more Blub for me, thank you, Vicar.
    Daniel Hirning
    Ranch Hand

    Joined: Sep 16, 2013
    Posts: 50

    Hi Chris,

    Thank you for such a detailed post, I had a good play around today sussing out my options.

    I scared myself with a download of Python xy, it came with Spyder so I thought why not, (600mb+ later)
    Good thing I'm on the 200GB plan!

    Took your suggestion for now and decided on V.3 as I am just starting out.

    For IDE's, I tried a version of IDLE, which in my opinion was a bucket of bolts, I also took a look at Spyder and while this was a serious step up my Eclipse bias won in the end. So I am currently running Pydev and quite happy so far.

    You really need to stay on the pydev site for installation instructions. The web is littered with all sorts of instructions, and half the authors out there need a kick, as they don't bother specifying what version their instructions are for.

    thanks again,
    chris webster

    Joined: Mar 01, 2009
    Posts: 1606

    Glad to help - hope you have fun with Python.

    One more tip: If you use a text editor for Python, make sure you tell it to use spaces instead of "\t" (tab) characters when tabbing e.g. when indenting your code. Most decent editors provide a simple configuration option for this, and it will save you lots of head-scratching when you cut and paste code between editors, as the whitespace all looks the same to us but Python sees "\t" and spaces differently when it's parsing your indented code.
    Daniel Hirning
    Ranch Hand

    Joined: Sep 16, 2013
    Posts: 50

    Good to know, thanks.
    I agree. Here's the link:
    subject: Learning Python
    Similar Threads
    why python ?
    New To Python
    Java vs Python
    Python or Ruby ?
    Python and Javascript