Learning Python now coming from Perl

Roy Smith roy at panix.com
Sat Dec 6 14:50:20 CET 2008


In article <ghdt15$6e7$1 at news.motzarella.org>,
 Bertilo Wennergren <bertilow at gmail.com> wrote:

> I'm planning to start learning Python now, using Python 3000.
> I have no previous Python skills, but I now Perl pretty well.
> I'm also well experienced with JavaScript.
> 
> Any pointers and tips how I should go about getting into
> Python?

I assume you use Perl to solve real problems in whatever job you do.  My 
recommendation would be the next time some problem comes up that you would 
normally solve with Perl, try doing it in Python.  Having a real task that 
you need to accomplish is a great way to focus the mind.  For your first 
project, pick something that's small enough that you think you could tackle 
it in under 50 lines of Perl.

One of the very first things you'll probably discover that's different 
between Perl and Python is how they handle string pattern matching.  In 
Perl, it's a built in part of the language syntax.  In Python, you use the 
re module.  The regular expressions themselves are the same, but the 
mechanism you use to apply them to input text is quite different.



More information about the Python-list mailing list