Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

New to Python, familiar with Perl - Seeking info sources

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


swiftone at swiftone

Jul 24, 2008, 6:53 AM

Post #1 of 5 (298 views)
Permalink
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].

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.



--
http://mail.python.org/mailman/listinfo/python-list


cokofreedom at gmail

Jul 24, 2008, 8:04 AM

Post #2 of 5 (276 views)
Permalink
Re: New to Python, familiar with Perl - Seeking info sources [In reply to]

On Jul 24, 3:53 pm, Brett Ritter <swift...@swiftone.org> wrote:
> 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 :)
--
http://mail.python.org/mailman/listinfo/python-list


wuwei23 at gmail

Jul 24, 2008, 9:34 AM

Post #3 of 5 (273 views)
Permalink
Re: New to Python, familiar with Perl - Seeking info sources [In reply to]

On Jul 24, 11:53 pm, Brett Ritter <swift...@swiftone.org> wrote:
> 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/
--
http://mail.python.org/mailman/listinfo/python-list


jr9445 at ATT

Jul 24, 2008, 11:55 AM

Post #4 of 5 (270 views)
Permalink
RE: New to Python, familiar with Perl - Seeking info sources [In reply to]

> -----Original Message-----
> From: python-list-bounces+jr9445=att.com [at] python [mailto:python-
> list-bounces+jr9445=att.com [at] python] On Behalf Of Brett Ritter
> Sent: Thursday, July 24, 2008 9:54 AM
> To: python-list [at] python
> 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].
>
<snip>
>
> 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.


--
http://mail.python.org/mailman/listinfo/python-list


bdesth.quelquechose at free

Jul 24, 2008, 12:18 PM

Post #5 of 5 (265 views)
Permalink
Re: New to Python, familiar with Perl - Seeking info sources [In reply to]

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 !-)

--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.