Getting Started With Python for the Web
Python, as some readers may know, is one of my favorite languages to work in. I’ve worked with PHP, and I’m currently doing some Ruby stuff and they’re both great languages, but something about Python and its community really motivates me.
I got my start with Python working with Jeff Croft at my old company Blue Flavor. Jeff has been a prominent figure of the Django community, which, like Rails, is really pushing that the Python community out on the web. There’s a pragmatism to Python that I think contrasts the Ruby community’s experimentations (both languages are great).
So some of you may be wondering how to break into Python, to start using it right away. It depends on your experience. The Python community is in a really awkward place right now, it’s suddenly starting to be attracted to girls, growing hair in odd places, and having a tough time transitioning to Python 3. This is actually where the pragmatism comes in… at a cost of speed.
So if you’re learning Python today, you’re learning Python 3, but you’ll be using 2.6 (or 2.7). Know that it’s ok to learn 3 and have to check why something isn’t working in 2. 2.6/2.7 are backwards compatible in many regards, so it shouldn’t be too difficult.
To really get started in Python it depends where you’re coming from.
For the absolute beginner at Programming: Learn Python The Hard Way is the best way to go. It will teach you the basic principles of programming and is written by an incredibly productive programmer.
For someone with experience in programming, or at least a generalist understanding, there is none better than The Python Tutorial, followed by Dive Into Python 3.
For those of you who just want to dive in, use the Quick Python Book to help you along the way.
EVERYONE should read The Python Style Guide in what the Python community calls a PEP. These are Python Enhancement Proposals, which are submissions to improve the Python language.
When you’re done learning Python, and you want to build websites you should check out:
And when you really want to dive in and build one yourself, you should learn about WSGI. Coincidentally, there are some issues with Python3 and WSGI, so you may want to also read this. These are advanced topics.
It never hurts to (on a Mac) sudo easy_install pip on the Terminal. Nor does it hurt to, after you install pip, sudo pip install ipython. PIP is the friendly Python package installer. If you use Ruby it’s similar (but not exactly) like gems.
Finally, when you’re all caught up on the frameworks and you got pip rocking. Do everyone a favor and read about Virtualenv, Virtualenvwrapper and Fabric. Everybody works with Virtualenvs these days!
You may want to sign up for a BitBucket account too as Python is what built Mercurial which a lot of Python fans use for version control (many use its cousin Git as well).
That’s how you get started, but to get good at it, you have to build stuff.
September, 17th 2010
Comments
I would also suggest TurboGears which is based on Pylons.
Posted at 10:34 AM on September 19, 2010
I was introduced to Python in graduate school when it was still fairly new. After taking JAVA, Python was like programming for idiots. No four line method to print Hello World, baby.
Posted at 08:53 AM on October 08, 2010
I find web2py as a great web framework to start with especially IF you are new to python. There is enough to learn, why add setting up the web frame work to that list? Great docs too. First web page in just a couple of minutes.
I use web2py in production web sites. I love it.
Posted at 01:29 PM on November 29, 2010
Post a Comment