Python for Perl Programmer

I am an experienced Perl developer with some experience and / or familiarity with other languages ​​(experience with C / C ++, school experience with Java and Scheme, as well as familiarity with many others). A.

I may need to do some work on the Internet in Python (most immediately related to the Google App Engine). So, I would like to ask SO overmind for good links on how best to learn Python for those coming from Perl background (for example, the focus will be on the differences between them and how to translate the perl idiomatics into Python idioms, as opposed to to generic Python links). Even better is that focused on web development. Will I take something - articles, tutorials, books, sample applications?

Thank!

+44
python perl
Feb 17 '10 at 17:43
source share
8 answers

I recently had to make a similar transition for work reasons, and it was pretty painful. For better or worse, Python has a completely different philosophy and way of working than Perl, and getting used to it can be frustrating. What I found most useful was

  • Spend a few hours going through all the basics. I found the official textbook not bad, if a little dry.
  • A good reference book for finding basic things ("how do I get the length of a string again?"). The most useful of these are the Python Pocket Reference and the Python Essential Reference .
  • Take a look at this handy Perl ↔ python phrasebook (common tasks, side by side, in both languages).
  • A reference to Python's approach to "common tasks." I am using a Python cookbook .
  • The ipython terminal is always open to check the syntax, methods, and methods of the introspect object.
  • Get pip and easy-install (to easily install Python modules).
  • Learn about unit tests quickly. This is because without use strict you will feel crippled and you will make many elementary errors that will appear as runtime errors. I recommend nose , not unittest , which comes with a basic setup. unittest is very verbose if you're used to Test :: More .
  • Check out Python stack stack overflow questions. In particular, Python - things that SHOULD get around and Python 2.x gotchas and land mines are worth reading.

Personally, I found Dive Into Python annoying and patronizing, but it's freely available on the Internet, so you can make up your own mind about it.

+59
Feb 17 '10 at 18:19
source share

If you happen to be a fan of The Perl Cookbook , you might be interested in checking out PLEAC, examples of the Alike Cookbook programming language , specifically the section that shows Perl Cookbook code translated into Python .

+12
Feb 18 '10 at 18:12
source share

As a hardcore Perl programmer, all I can say is DO NOT BUY O'Reilly "Learning Python". Nowhere is it as good as Learning Perl, and there is no equivalent that I know of Larry Wall's β€œProgramming Perl”, which is simply unbeatable.

I have achieved the greatest success in implementing Perl programs and translated them into Python, trying to use as many new technologies as possible.

+7
Feb 18 '10 at 6:16
source share

Check out the official tutorial which is actually very good. If you are interested in web development, you should be ready at this moment to go directly to the documentation of the web structure with which you will work; Python has many options: with zope, cherrypy, pylons and werkzeug, all of which have a good reputation.

I would not look for things specifically designed to help you switch from Perl, which should not be of the same high quality as links that may be useful to more people.

+4
Feb 17 '10 at 18:02
source share

This is the site you really have to go to. There will be a section called Getting Started that you should look at. There are also book recommendations. You might also be interested in this in idioms.

+3
Feb 18 '10 at 1:17
source share

Download the book from here . Read, sigh and eat. :)

This is good for everyone.

And updated for Python3 .

+2
Feb 17 2018-10-17
source share

If you are looking at a brief, concise link to python, then the Python Essential Reference book may be useful.

+2
Feb 17 '10 at 18:08
source share

I would not try to compare Perl and Python too much to learn Python, especially since you have knowledge of other languages. If you are not familiar with the aspects of OOP / functional programming and just try to work procedurally, as in Perl, start by exploring Python constructs / syntax, and then do a couple of examples. if you move on to OO paradigms or functional style, I will first read the basics of OO, and then start the Python syntax and examples ... so you have a kind of mental plan of how things can be created before you get started with actual materials. this is just my humble opinion.

-3
Feb 17 '10 at 17:51
source share



All Articles