New to Python, familiar with Perl - Seeking info sources

B

Brett Ritter

After many years happily coding Perl, I'm looking to expand my
horizons. [no flames please, I'm pretty aware of Perl's strengths and
weaknesses and I'm just here to learn more, not to enter religious
debates].

I've gone through some of the online tutorials and I'll be browsing
the reference before starting the "code a lot" phase.

My question is: What are the best sources to learn best practices or
get the answers to questions? Are there any good sources to tell me
what Perl habits are good/bad in the Python paradigm? What about
common packages that will change my life? (I do a lot of web work,
but also a lot of DB reporting) I'm also working as a Java developer
primarily, so I'm glad to see that Jython has been resurrected, but
I'm focusing on vanilla Python for the moment.

As examples: PerlMonks has been my info source. The Perl Best
Practices and Higher Order Perl books have been my tutors into better
coding practices. CPAN has my life easy, giving me access to the DBI,
Class::DBI (and its successors), HTML::FillInForm,
Data::FormValidator, CGI::Application, and Text::CSV::Simple modules
that are staples of my coding. The (occasionally complete) Perl
Advent calendars have proven to be a good source to learn about
helpful modules that I might not otherwise stumble across.

(I've encountered Django, but I'm getting my fill of "frameworks" from
Java for the moment, so I'm looking for lightweight pieces at the
moment)

My (admittedly brief) searches here and on google didn't lead me to
any particular spots of concentrated Python info, and most of the Perl/
Python stuff is either a smug attack by one camp on the other or a
rant about the behavior of an obscure feature between the two.

Any recommendations? Thanks in advance.
 
C

cokofreedom

After many years happily coding Perl, I'm looking to expand my
horizons. [no flames please, I'm pretty aware of Perl's strengths and
weaknesses and I'm just here to learn more, not to enter religious
debates].

I've gone through some of the online tutorials and I'll be browsing
the reference before starting the "code a lot" phase.

My question is: What are the best sources to learn best practices or
get the answers to questions? Are there any good sources to tell me
what Perl habits are good/bad in the Python paradigm? What about
common packages that will change my life? (I do a lot of web work,
but also a lot of DB reporting) I'm also working as a Java developer
primarily, so I'm glad to see that Jython has been resurrected, but
I'm focusing on vanilla Python for the moment.

As examples: PerlMonks has been my info source. The Perl Best
Practices and Higher Order Perl books have been my tutors into better
coding practices. CPAN has my life easy, giving me access to the DBI,
Class::DBI (and its successors), HTML::FillInForm,
Data::FormValidator, CGI::Application, and Text::CSV::Simple modules
that are staples of my coding. The (occasionally complete) Perl
Advent calendars have proven to be a good source to learn about
helpful modules that I might not otherwise stumble across.

(I've encountered Django, but I'm getting my fill of "frameworks" from
Java for the moment, so I'm looking for lightweight pieces at the
moment)

My (admittedly brief) searches here and on google didn't lead me to
any particular spots of concentrated Python info, and most of the Perl/
Python stuff is either a smug attack by one camp on the other or a
rant about the behavior of an obscure feature between the two.

Any recommendations? Thanks in advance.

Best start is a quick read of DiveIntoPython that provides a nice
account of how to work with Python, and relates to coming from a
programming background. I also keep this List on my bookmarks, as well
as the python library (http://docs.python.org//lib/).

The ActiveState Python Cookbook (http://aspn.activestate.com/ASPN/
Python/Cookbook/) generally has a lot of useful code snippets worth
using.

Zen of Python (http://www.python.org/dev/peps/pep-0020/) shows the
idea of Python and (http://www.python.org/dev/peps/pep-0008/) is the
Style Guidelines for Python code.

I haven't worked with the web and Python much yet so maybe someone
else can help you there. Welcome :)
 
A

alex23

My question is: What are the best sources to learn best practices or
Are there any good sources to tell me
what Perl habits are good/bad in the Python paradigm?

I've never used Perl myself, so I can't comment on the quality, but
this document was recommended earlier this week:
http://wiki.python.org/moin/PerlPhrasebook
What about
common packages that will change my life? (I do a lot of web work,
but also a lot of DB reporting)

If you're not anti-ORM, I highly recommend checking out SQLAlchemy.
It's not part of the standard lib, but it's an amazing tool:
http://www.sqlalchemy.org/
The (occasionally complete) Perl
Advent calendars have proven to be a good source to learn about
helpful modules that I might not otherwise stumble across.

You might appreciate Doug Hellman's Python Module of the Week blog:
http://www.doughellmann.com/projects/PyMOTW/
(I've encountered Django, but I'm getting my fill of "frameworks" from
Java for the moment, so I'm looking for lightweight pieces at the
moment)

The Web Services Gateway Interface (WSGI) was designed to promote the
building of web applications using interchangeable middleware. It's
definitely worth having an understanding of if you plan on developing
web apps in Python:
http://www.wsgi.org/wsgi/

If you're wanting to avoid the larger frameworks, check out CherryPy,
it's a thing of beauty:
http://www.cherrypy.org/
 
R

Reedick, Andrew

-----Original Message-----
From: [email protected] [mailto:python-
[email protected]] On Behalf Of Brett Ritter
Sent: Thursday, July 24, 2008 9:54 AM
To: (e-mail address removed)
Subject: New to Python, familiar with Perl - Seeking info sources

After many years happily coding Perl, I'm looking to expand my
horizons. [no flames please, I'm pretty aware of Perl's strengths and
weaknesses and I'm just here to learn more, not to enter religious
debates].
Any recommendations? Thanks in advance.

I have a Perl background and have found the O'Reilly books to be useful.
The Learning Python book (or whatever it's called) is good because it
covers the paradigm shifts and potential gotchas that you won't even
consider thinking about otherwise. Only downside is wading through the
novice 'how to program' parts. The Cookbook is also good for getting
'standard' apps up and running quickly (meaning you know how to do it in
Perl, and just need the equivalent Python syntax/paradigm.)

The Python help can be very hit or miss. You're going to have _fun_
with the Python regex module. *twitch*winch*sputter* Generally
speaking, there's a Python module to do just about everything you could
do in Perl. The only gap I've found is in the win32com with a class in
a .tlb file (works fine in Perl, fails in Python.) But someone on the
python-win32 list posted a potential workaround which I need to test.

The really spiffy part is that when I converted a few Perl scripts to
Python, the Python scripts were a bit smaller. =O Python does less
compile time type checking than Perl. And finally, this mailing list
does produce useful, polite answers about syntax to theory, despite some
noise.
 
B

Bruno Desthuilliers

Brett Ritter a écrit :
After many years happily coding Perl, I'm looking to expand my
horizons. [no flames please, I'm pretty aware of Perl's strengths and
weaknesses and I'm just here to learn more, not to enter religious
debates].

I've gone through some of the online tutorials and I'll be browsing
the reference before starting the "code a lot" phase.

My question is: What are the best sources to learn best practices or
get the answers to questions? Are there any good sources to tell me
what Perl habits are good/bad in the Python paradigm? What about
common packages that will change my life? (I do a lot of web work,
but also a lot of DB reporting)

wrt/ "best practices" and writing pythonic code, the best thing to do is
probably to lurk here and post code snippets asking for code reviews (we
just *love* that !-)

Others already pointed you to useful readings like diveintopython. I'd
like to add Fredrik Lundh (aka the effbot)'s excellent website to the list:
http://effbot.org/

wrt/ packages, first take time to read the stdlib's package index - I've
a couple time Reinvented The Square Wheel(tm) when a well-rounded one
was just an import away. You'll also find useful resources on pypi (the
Python's Package Index).

I'm also working as a Java developer
primarily, so I'm glad to see that Jython has been resurrected, but
I'm focusing on vanilla Python for the moment.

As examples: PerlMonks has been my info source. The Perl Best
Practices and Higher Order Perl books have been my tutors into better
coding practices.

This newsgroup, diveintopython, effbot.org...
CPAN has my life easy,

Not quite close to CPAN, but the closest we actually have IMHO: pypi
(for the package index) and easy_install.
giving me access to the DBI,
Class::DBI (and its successors),

low-level : Python db-api
hi-level : SQLAlchemy
HTML::FillInForm,

Don't know what this one do...
Data::FormValidator,
FormEncode

CGI::Application,

cgi and wsgi...
and Text::CSV::Simple modules

You probably want the csv package (in the stdlib).

You may also want to have a look at templating engines like Mako or Genshi.
that are staples of my coding. The (occasionally complete) Perl
Advent calendars have proven to be a good source to learn about
helpful modules that I might not otherwise stumble across.

python-announces ?
(I've encountered Django, but I'm getting my fill of "frameworks" from
Java for the moment, so I'm looking for lightweight pieces at the
moment)

While not exactly lighweight by Python's standards, Django is certainly
way lighter than the usual Java web framework. But Python is known to
have more web frameworks than keywords, so you may find something
lightweight enough for your taste - or of course write your own !-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top