Learning Python now coming from Perl

2008-12-06 Thread Bertilo Wennergren

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?

--
Bertilo Wennergren <http://bertilow.com>
--
http://mail.python.org/mailman/listinfo/python-list


Re: Learning Python now coming from Perl

2008-12-06 Thread Bertilo Wennergren

Roy Smith wrote:


 Bertilo Wennergren <[EMAIL PROTECTED]> 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.


Good advice.

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.


Thanks.

I don't suppose there is any introductory material out there
that is based on Python 3000 and that is also geared at people
with a Perl background? Too early for that I guess..

--
Bertilo Wennergren <http://bertilow.com>
--
http://mail.python.org/mailman/listinfo/python-list


Re: Learning Python now coming from Perl

2008-12-06 Thread Bertilo Wennergren

Aahz wrote:


In article <[EMAIL PROTECTED]>,



Bertilo Wennergren  <[EMAIL PROTECTED]> wrote:



I don't suppose there is any introductory material out there that is
based on Python 3000 and that is also geared at people with a Perl
background? Too early for that I guess..



Honestly, the differences between 2.x and 3.0 are small enough that it
doesn't much matter, as long as you're not the kind of person who gets
put off by little problems.  Because so much material is for 2.x, you
may be better off just learning 2.x first and then moving to 3.x.


The main reason I waited until Python 3000 came out is
the new way Unicode is handled. The old way seemed really
broken to me. Much of what I do when I program consists
of juggling Unicode text (real Unicode text with lots of
actual characters outside of Latin 1). So in my case
learning version 2.x first might not be very convenient.
I'd just get bogged down with the strange way 2.x handles
such data. I'd rather skip that completely and just go
with the Unicode handling in 3.0.

--
Bertilo Wennergren <http://bertilow.com>
--
http://mail.python.org/mailman/listinfo/python-list