60

I am an experienced Perl developer with some degree of experience and/or familiarity with other languages (working experience with C/C++, school experience with Java and Scheme, and passing familiarity with many others).

I might need to get some web work done in Python (most immediately, related to Google App Engine). As such, I'd like to ask SO overmind for good references on how to best learn Python for someone who's coming from Perl background (e.g. the emphasis would be on differences between the two and how to translate perl idiomatics into Python idiomatics, as opposed to generic Python references). Something also centered on Web development is even better.I'll take anything - articles, tutorials, books, sample apps?

Thanks!

nicael's user avatar
nicael
19.1k13 gold badges64 silver badges93 bronze badges
askedFeb 17, 2010 at 17:43
DVK's user avatar
1

7 Answers7

73

I've recently had to make a similar transition for work reasons, and it's been pretty painful. For better or worse, Python has a very different philosophy and way of working than Perl, and getting used to that can be frustrating. The things I've found most useful have been

Personally, I foundDive Into Python annoying and patronising, but it's freely available online, so you can form your own judgment on that.

kjpires's user avatar
kjpires
7404 silver badges14 bronze badges
answeredFeb 17, 2010 at 18:19
ire_and_curses's user avatar
Sign up to request clarification or add additional context in comments.

1 Comment

Can you explain the "different philosophy and way of working"?
16
answeredFeb 18, 2010 at 18:12
Philip Durbin's user avatar

Comments

8

Being a hardcore Perl programmer, all I can say isDO NOT BUY O'Reilly's "Learning Python". It is nowhere NEAR as good as "Learning Perl", and there's no equivalent I know of to Larry Wall's "Programming Perl", which is simply unbeatable.

I've had the most success taking past Perl programs and translating them into Python, trying to make use of as many new techniques as possible.

answeredFeb 18, 2010 at 6:16
larley's user avatar

Comments

4

Check out theofficial tutorial, which is actually pretty good. If you are interested in web development you should be ready at that point to jump right in to the documentation of the web framework you will be working with; Python has many to choose from, with zope, cherrypy, pylons, and werkzeug all having good reputations.

I would not try to search for things specifically meant to help you transition from Perl, which are not to be of as high of quality as references that can be useful for more people.

answeredFeb 17, 2010 at 18:02
Mike Graham's user avatar

Comments

3

This is the site you should really go to. There's a section calledGetting Started which you should take a look. There are also recommendations on books. On top of that, you might also be interested inthis on "idioms"

answeredFeb 18, 2010 at 1:17
ghostdog74's user avatar

Comments

2

If what you are looking at is succinct, concise reference to python then the bookPython Essential Referencemight be helpful.

answeredFeb 17, 2010 at 18:08
sateesh's user avatar

Comments

-3

I wouldn't try to compare Perl and Python too much in order to learn Python, especially since you have working knowledge of other languages. If you are unfamiliar with OOP/Functional programming aspects and just looking to work procedurally like in Perl, start learning the Python language constructs / syntax and then do a couple examples. if you are making a switch to OO or functional style paradigms, I would read up on OO fundamentals first, then start on Python syntax and examples...so you have a sort of mental blueprint of how things can be constructed before you start working with the actual materials. this is just my humble opinion however..

answeredFeb 17, 2010 at 17:51
jellyfishtree's user avatar

5 Comments

Psst. Modern Perl developers use OO just as much as anyone else. And, as usual, TMTOWTDI. ;)
@jellyfishtree - i'll try to not be offended, but really, that assumption was a bit uncalled for. I write fully OO code in Perl (as well as C++) - I did say I was an experienced Perl developer, not a script monkey - in addition I can do functional programming although with far less experience/quality :)
Perl and Python OO systems are very similar - Perl' s one was copied from Python.
Robert P: Not modern too - OO appeared in Perl long ago.
ahh, snap..i forgot. Perl packages right? no offense intended, just so used to people using it for procedural scripts I forgot about the possibility. _| ̄|○

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.