views:

379

answers:

7

I'm cobbling together some sort of an introduction to Python, but one that focuses on the community and the ecosystem around Python rather than just the language. With How to Think Like a Computer Scientist and other great tutorials, it's easy to get familiar with the language, but it took me a fair while before I knew what The Cheese Shop, or, err, PyPi is about, how pip and virtualenv work and why you should use them, where you should go for help, the interesting blogs that you should follow, how your code should look (PEP 8, writing pythonic code) and so on. The 'soft stuff'.

What confused you the most when you just started out with Python? Are there certain things that you would've wanted to know about, or resources you wish you would have stumbled upon earlier than you did? People to know about?

I found a few similar questions on StackOverflow (e.g. here) but nothing really close to what I'd like to hear from you guys. Hope this question doesn't feel too subjective to your tastes :-)

(And, if you'd like to help out, feel free to send a message.)

+4  A: 

explaining what a PEP is, how it is written and who wrote them, where we can find them. PEPs give a lot of background informations about a specific feature of the language. they also are the tool which shows how fast evolving python is.

(i wish i had read some PEPs earlier, but i was not really aware of them, although they are frequently linked in the manual)

Adrien Plisson
If you explain them to your co-workers, are you giving a PEP talk?
Michael Myers
definitely yes.
Adrien Plisson
+19  A: 

I think one of the most important thing a beginner need to know about Python ecosystem is that it's a general purpose language surrounded by specialized libs. Experienced pythonistas know them, but a newbie can't:

The main ones should be listed in a book with guidances to choose among them.

e-satis
I'd add CherryPy and Genshi to web coding
Otto Allmendinger
Very much in agreement here. It can be very dizzifying trying to choose between all kinds of libraries and frameworks, so a birds-eye view of what's out there (both in the standard lib and outside of it) would be very helpful for those new to Python. Thanks for the idea!
Stijn Debrouwere
I think the "don't stop to tkinter" advice is short-sighted. Tkinter is a terrific solution for certain types of problems.
Bryan Oakley
+4  A: 

"What confused you the most when you just started out with Python?"

Rule 1 of learning Python: Use the Source, Luke.

There are question on SO asking for "good" source from which to learn Python. The best answers amount to "read the libraries that came with Python."

One can say that the libraries that come with Python are quirky. In places. Which makes them all the better for learning from.

  1. There's a community of like-minded people who are not clones.

  2. Open source software is the highest-quality software you'll ever get to work with, but it's not created by paid developers who will rigidly enforce standards.

S.Lott
+9  A: 

"What confused you the most when you just started out with Python?"

Rule 2 of learning Python: Any general-purpose module or framework you think you want has already been written. Several times.

The hard part is realizing that your idea is

  1. Not unique.

  2. Been already improved upon before you even starting thinking about it.

  3. Already posted somewhere.

So, code less and search more. Search widely and flexibly until you find things that are similar to what you want to do.

  • Realize that you might have a name you think is descriptive. But other folks may call it something different. Join the community, adopt their naming. You may not like the phrase "ORM", but that's what it's called.

  • Realize that your idea, no matter how sound it seems, may be really poor. When you find a framework that seems to have "needless extra features", you may be missing something from your idea.

  • Realize that your idea, no matter how "intuitive" it seems, may be really poor. When you find a framework that seems "counter-intuitive", the problem could be yours. Learn theirs first, then compare and contrast after you've mastered theirs. Until you've mastered theirs, keep searching and learning.

S.Lott
Well, this is not Python advices. It's true in general programming.
e-satis
... research, too. The sooner an engineer realizes and accepts what already exists, the faster he/she can reach and advance the state of the art. While not Python specific, good answer nonetheless.
Steve
Good advice! People need to realize that asking the right questions to find what you need, is a skill that takes time to develop.
Stijn Debrouwere
+6  A: 

A few points related to the ecosystem and indirectly the community:

  • I wished I had been reminded more about the Batteries included. I think people should be told to print-out the Table of Contents of the Standard Library and keep it under their pillow, for frequent reviews (that advice, I finally took, several years into it, from an online intro/beginner's video presentation!). The [relative] stability, extensive but relevant content of the Std Lib speaks to the thoughtful governance of the community leaders and its beloved BDFL.

  • I think newcomers can also be "warned" (the word is maybe too strong, too unfair) about the extreme variety of PiPy. This reflects the vibrant, smart and diverse (in terms of background, domain of application, interests...) collective of users and contributors. This however can be overwhelming and possibly risky as all packages in there are not "prime time ready" (But many are and "saved my life" many times over).

  • Even if you feel too new to Python, don't only use the libraries, do peek under the hood! This is true of many languages, but maybe particularly of Python, there's much to be learned from perusing various source code. The reasons this may be particular true for Python are intrinsic to the language itself (multi-paradigms, hi level of abstraction...) but also because of the relative uniformity of coding (and architecting) style and because of the general level of collaboration within the community.

mjv
give link to Table of Contents of the Standard Library
Daniel T. Magnusson
http://docs.python.org/library/ -- good point by the way. I browsed through the docs for the standard library for the first time about a year and a half after I first touched Python, and remember thinking how much easier it would've made things for me if only I'd have known about it earlier on.
Stijn Debrouwere
@mjv grammar check: to peek -> do peek
Tshepang
@Tshepang: thanks!
mjv
+4  A: 

From PEP 20:

import this

(aka, the Zen of Python)

Roberto Liffredo
I think especially that explaining the usefulness of namespaces (for people coming from PHP) and of explicitness (for people looking into both Ruby and Python) is key to understanding Python. It keeps amazing me how spot-on the Zen of Python is :)
Stijn Debrouwere
I have actually used that PEP several times to justify my comments in code reviews.
Roberto Liffredo
+1  A: 

developing a python package that can be installed with easy_install etc... I consider it equivalent to developing a jar or dll etc....

on the same token, developing said package(s) with virtualenv or buildout

If I would have known those things sooner, I would have probably used python for more than just scripting way back when I first started using it.

Tom Willis