Professional quality scripts/code

R

robean

I have been learning Python for the last 3 months or so and I have a
working (but somewhat patchy) sense of the the language. I've been
using a couple of the more popular Python books as well as online
resources.

A question for experienced Python programmers: can you recommend
resources where I can look at high quality Python code and scripts?
I've spent some time at http://code.activestate.com/recipes/ but am
concerned that the quality of what is posted there can be somewhat hit
and miss. What I have in mind is a site like cpan, where one can look
at the actual source code of many of the modules and learn a thing or
two about idiomatic Perl programming from studying the better ones.
Any sites like that for Python? (You can of course look up Python
modules on docs.python.org, but, as far as I can tell, not the actual
source code). Many thanks.
 
M

Mike Driscoll

I have been learning Python for the last 3 months or so and I have a
working (but somewhat patchy) sense of the the language. I've been
using a couple of the more popular Python books as well as online
resources.

A question for experienced Python programmers: can you recommend
resources where I can look at high quality Python code and scripts?
I've spent some time athttp://code.activestate.com/recipes/but am
concerned that the quality of what is posted there can be somewhat hit
and miss.  What I have in mind is a site like cpan, where one can look
at the actual source code of many of the modules and learn a thing or
two about idiomatic Perl programming from studying the better ones.
Any sites like that for Python? (You can of course look up Python
modules on docs.python.org, but, as far as I can tell, not the actual
source code). Many thanks.


You can look at any of the standard module's source code in your Lib
directory including any 3rd party modules you've downloaded. You could
also browse SourceForge or Google Code.

Mike
 
B

Bruno Desthuilliers

robean a écrit :
I have been learning Python for the last 3 months or so and I have a
working (but somewhat patchy) sense of the the language. I've been
using a couple of the more popular Python books as well as online
resources.

A question for experienced Python programmers: can you recommend
resources where I can look at high quality Python code and scripts?

Well... Not everything is 'high quality' in it[1], but why not start
with the stdlib ? Most of it is pure Python, opensource code and is
already installed on your machine, isn't it ?-)

[1] IIRC, last time I had a look at the zipfile module's code, it was
more of a Q&D hack than anything else - now as long as it works fine for
what I do with it and I don't have to maintain it, well, that's fine.
I've spent some time at http://code.activestate.com/recipes/ but am
concerned that the quality of what is posted there can be somewhat hit
and miss.
Indeed.

What I have in mind is a site like cpan, where one can look
at the actual source code of many of the modules and learn a thing or
two about idiomatic Perl programming from studying the better ones.
Any sites like that for Python?

Lurking here is probably a good way to see a lot of code reviews. And
even possibly to submit snippets of your own code to review. Some (if
not most) of us here like to show how good we are at improving the poor
newbies code !-)
 
R

robean

robean a crit :
I have been learning Python for the last 3 months or so and I have a
working (but somewhat patchy) sense of the the language. I've been
using a couple of the more popular Python books as well as online
resources.
A question for experienced Python programmers: can you recommend
resources where I can look at high quality Python code and scripts?

Well... Not everything is 'high quality' in it[1], but why not start
with the stdlib ? Most of it is pure Python, opensource code and is
already installed on your machine, isn't it ?-)

[1] IIRC, last time I had a look at the zipfile module's code, it was
more of a Q&D hack than anything else - now as long as it works fine for
what I do with it and I don't have to maintain it, well, that's fine.
I've spent some time athttp://code.activestate.com/recipes/but am
concerned that the quality of what is posted there can be somewhat hit
and miss.
Indeed.

 What I have in mind is a site like cpan, where one can look
at the actual source code of many of the modules and learn a thing or
two about idiomatic Perl programming from studying the better ones.
Any sites like that for Python?

Lurking here is probably a good way to see a lot of code reviews. And
even possibly to submit snippets of your own code to review. Some (if
not most) of us here like to show how good we are at improving the poor
newbies code !-)

Many thanks, Mike and Bruno,

The resources you mention are exactly the kind of stuff I was looking
for. Soon enough I hope to give all of you many chances to improve
this poor newbie's code...!

- Robean
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top