1,159 posts tagged “python”
The Python programming language.
2011
What are the most practical beneficials for Python, comparing to Java?
For me, the single most productive advantage of Python is the ability to work with it interactively in a REPL—I use ipython but Python also ships with an interactive mode out of the box.
[... 176 words]Is it better to do Python development on an SSD, or on a mechanical disk?
SSDs are faster than regular drives for every application—Python is no different. That said, unless the Python code you are developing does a huge amount of disk IO you probably won’t notice the difference.
[... 57 words]What is a good video series on learning Python?
It probably won’t teach you the basics, but we’ve collected 190 videos from conference talks about Python here: http://lanyrd.com/topics/python/...
[... 35 words]Twitter API: What is the best data storage mechanism and client library for analysing tweets using Python?
It depends on how much data you intend to collect, and how you intend to then share that data.
[... 182 words]Is South the best tool to use when doing database migrations in Django?
Yes. And I say that as an author of another Django migrations tool (dmigrations) which offered a small subset of South’s current functionality.
[... 42 words]The First Few Weeks—ep.io. Another take on managed Python Django/WSGI hosting, from Andrew Godwin and Ben Firshman.
What’s a good web dev platform if I work in Python, but want something faster to set up than Django?
Sounds like the perfect use case for Google App Engine, with its offline task queues and one-click deployment.
[... 44 words]2010
HotQueue. A super-simple Python work queue using Redis. The API is neat, and makes clever use of generators for blocking consumption of queue items.
What are the tradeoffs (e.g. development speed, performance, scalability) between using various php frameworks, ruby/rails, or python/django? Is there any reason to choose one overwhelmingly over another?
At this point, I’d argue that the decision between them comes down to programming language rather than framework—the frameworks have mostly converged on a very similar set of features.
[... 145 words]Who are the top Python programmers on Twitter?
Our site Lanyrd catalogs conference speakers by their Twitter ID, so you could use it to find people who speak at Python conferences—for example:
[... 52 words]Why does Python load imported modules separately for different files, unlike C or PHP? Isn’t that inefficient in terms of memory usage?
It doesn’t—you’re misunderstanding how Python’s module system works. If two different places have “import os” in them, the os module is only imported and executed once—it’s cached in the sys.modules dictionary so you can see it happen if you want to. The key thing to understand is that “import os” attaches the os module to the “os” symbol within the current file’s scope, loading it only if it hasn’t been loaded already.
[... 104 words]What’s a good book about basic usage techniques and patterns in Python? (a la Effective Java/C++)
Dive into Python 3 is well worth a look: http://diveintopython3.org/
[... 48 words]Bleach, HTML sanitizer and auto-linker. HTML sanitisation is notoriously difficult to do correctly, but Bleach (a Python library) looks like an excellent effort. It uses the html5lib parsing library to deal with potentially malformed HTML, uses a whitelist rather than a blacklist and has a neat feature for auto-linking URLs that is aware of the DOM (so it won’t try to auto-link a URL that is already wrapped in a link element). It was written by the Mozilla team for addons.mozilla.org and support.mozilla.org so it should be production ready.
What does the key word “yield” in Python do?
The best documentation I’ve seen on generators is this: http://www.dabeaz.com/generators/
[... 26 words]Who are the best Python developers in Los Angeles?
Mahalo is based in Santa Monica, and they have a very talented team of Python/Django people. They also host a regular Django meetup: http://www.meetup.com/ladjango/
[... 40 words]What are some tips for a new Python developer coming from C++/Java?
Read “Python is not Java” from 2004—it has some good tips on how working with the two languages differs.
[... 41 words]Is the complexity of basic Python data structure operations documented?
Python’s C code has some excellent documentation, including detailed write-ups of how Python’s dictionary and sorting algorithms work. They’re a great read.
[... 42 words]What’s the easiest way to take an existing Django view and make it “real time” via long polling?
I’d advocate decoupling your long polling endpoints entirely from the rest of your web app stack. Personally I like Node.js for this, but Tornado would work just fine too (I’ve experimented successfully with Tornado long polling in the past).
[... 171 words]I think that “bad technology” can kill a startup, but slightly different variations of good technology don’t have much effect. Choose what you know/like best. And Ruby and Python are both in this latter category.
ijson. A SAX-style streaming JSON parser for Python, using ctypes to talk to the yajl C library.
Does SQLAlchemy depend on MySQLdb?
No. SQLAlchemy can talk to all sorts of different DB-API compliant backends, including MySQL Connector/J (Jython only), MySQL Connector/Python, mysql-python (the MySQLdb module) and OurSQL—plus backends for many other databases. See the full list here:
[... 50 words]What is the best way to learn about setting up server software for Python based web apps?
I’m a big fan of Fabric for automated deployment scripts. Start by reading this tutorial: http://morethanseven.net/2009/07...
[... 40 words]What is the highest traffic website built on top of Django?
My best guess would be Disqus. Instagram are pretty enormous these days as well.
[... 31 words]Writing your own traceroute in Python. How to implement traceroute in Python, using the low-level socket module.
What to do when PyPI goes down. My deployment scripts tend to rely on PyPI these days (they install dependencies in to a virtualenv) which makes me distinctly uncomfortable. Jacob explains how to use the PyPI mirrors that are starting to come online, but that won’t help if the PyPI listing links to an externally hosted file which starts to 404, as happened with the python-openid package quite recently (now fixed). The comments on the post discuss workarounds, including hosting your own PyPI mirror or bundling tar.gz files of your dependencies with your project.
simplegeo’s python-oauth2. The Python OAuth library scene is frighteningly complicated at the moment. This seems to be the most actively maintained, and the readme includes working example code for talking to the Twitter API (including integration with Django auth).
MapOSMatic. Clever service built on top of OpenStreetMap, which renders double sided city maps with a map and grid on one size and an A-Z street name index on the other. Runs on top of Mapnik, PostGIS and Cairo, with a few thousand additional lines of Python and Django.
python/trunk/Lib/httplib.py in 1994 (via) Python’s original httplib implementation, checked in by Guido 16 years and 4 months ago. Not much younger than the Web itself.
Python 2.7 Release. Includes three of my favourite features from Python 3: odicts, set literals and set and dictionary comprehensions.