
Congratulations! You're using #python
, the foremost support system
for developing quality Python applications. We hope you'll enjoy
its many unique advantages:
- #python is for helping people write better programs
- This means that when you ask a question, you can expect our
crack team of Python experts to not merely deal with the trivial
details of syntax and library usage that can easily be looked up
on a search engine, but to go deeper into the design issues that
can only truly be addressed in the context of your
application. Expect personalized service when you're having
trouble making your code behave properly. Your time won't be
wasted by architecture astronauts or trivial repetitions of the
docs -- just solid advice on making your code correct, readable,
uncomplicated, and usable.
- #python is a high signal environment
- Despite being a large channel, with up to 800 participants on
a busy day, discussion of Python problems is always front and
center, in clear English. Our tireless moderators ensure that
disruptive conversations and people are removed from the channel
quickly and with a minimum of fuss. When your program is
crashing and you don't know why, you don't have to worry about
being drowned out by pointless chatter. Most notably, we don't
tolerate use of "LOL" or other forms of 'chatspeak'.
Best Practices
For your convenience, here's a list of our advice in
common situations we've seen people bring to us:
- When deciding on how to layout your project
- It is best to read the piece of work JP Calderone wrote on this subject.
- When parsing XML or HTML, use the lxml
library
-
lxml is probably the
best library for XML and HTML parsing available. Its
lxml.etree module is API-compatible with the stdlib
ElementTree module, while providing many extensions such as
full XPath support, XSLT support, and DTD/schema validation.
Its HTML support (in lxml.html) is both fast and
correct, optionally using either html5lib or BeautifulSoup
for corner cases. See Ian Bicking's post
about its HTML abilities.
- When storing data, use SQLite or JSON
- Both SQLite and JSON are available in Python's standard
library and provide good support for interoperable,
human-readable simple file-based data storage. As a web
standard, JSON is also an excellent format for data
interchange between Python programs, or Python code and
programs written in other languages.
- On using Python 2.x or Python 3.x
- See this
article on the Python wiki.
- On doing networking
- #python will generally refer you to Twisted for anything
network-related.
- On using threads
- Using threads in Python does not offer what you want to
accomplish in about 90% of the cases. In this 90% of cases threads
are not the answer. If you are looking for a threads-like API you
should look at the multiprocessing module.
Allen Short
et al.