Python Patterns & Practices

Find The Best Answers To Your Python Coding Problems



python - jython date conversion

Properly formatted example for Python iMAP email access?

python - How would you design a very "Pythonic" UI framework?

linux - How to make a python, command-line program autocomplete arbitrary things NOT interpreter

python - Is it possible to use wxPython inside IronPython?

python - How to debug Web2py applications?

streaming - How do I capture an mp3 stream with python

documentation - How to document Python code using Doxygen

python - How to programmatically enable/disable network interfaces? (Windows XP)

Python Authentication API

Python 2.5.2 and Solaris 8 (gcc 3.4.2) build issues

web applications - How would one make Python objects persistent in a web-app?

Counting array elements in Python

data mining - Comparing multiple dictionaries in Python

python - Why would an "command not recognized" error occur only when a window is populated?

Best online resource to learn Python?

How do I get the external IP of a socket in Python?

python - Is there any list of blog engines, written in Django?

python - Converting datetime to POSIX time

python - Are there problems developing Django on Jython?

python - How to make parts of a website under SSL and the rest not?

regex - Does re.compile() or any given Python library call throw an exception?

python - Django debugging with Emacs

python - Django Admin Interface Does Not Use Subclass's __unicode__()

python - Parsing a string for nested patterns

python - How to embed a tag within a url templatetag in a django template?

Can I implement a web user authentication system in python without POST?

Base-2 (Binary) Representation Using Python

Python as FastCGI under windows and apache

Python + DNS : Cannot get RRSIG records: No Answer

windows - How can I download python .egg files, when behind a firewall

python - round() doesn't seem to be rounding properly

javascript - Django authentication and Ajax - URLs that require login

java - Best server-side framework for heavy RIA based application?

Tiny python executable?

Configuration file with list of key-value pairs in python

decorator - Python decorating functions before call

python - Replace textarea with rich text editor in Django Admin?

Python equivalent of continuations with Ruby

Take a screenshot via a Python script on Linux

python - PyQt and PyCairo

In Python, is there a concise way of comparing whether the contents of two text files are the same?

exception - Python: Problem with overloaded constructors

python - Anyone used Dabo for a medium-big project?

python - How can I do synchronous rpc calls

linux - Python crypt module -- what's the correct use of salts?

Splitting a semicolon-separated string to a dictionary, in Python

python - Open explorer on a file

In Python, is there a concise way to use a list comprehension with multiple iterators?

sql - Looking a generic Python script to add a field and populate the field with conditions

Python, optparse and file mask

python - 'from X import a' versus 'import X; X.a'

XML writing tools for Python

What Python bindings are there for CVS or SVN?

networking - Best way to open a socket in Python

python - How to configure the import path in Visual Studio IronPython projects

twisted - Python - How to use Conch to create a Virtual SSH server

coding style - Single quotes vs. double quotes in Python

python - Debugging pylons in Eclipse under Ubuntu

regex - Python regular expression for HTML parsing (BeautifulSoup)

Finding invocations of a certain function in a c++ file using python

python - No Module named django.core

How can I get Emacs' key bindings in Python's IDLE?

python - Extracting unique items from a list of mappings

PythonWin's python interactive shell calling constructors twice?

sorting - In Python, how can you easily retrieve sorted items from a dictionary?

performance - Are tuples more efficient than lists in Python?

Python 2.6 + JCC + Pylucene issue

python - libxml2-p25 on OS X 10.5 needs sudo?

python - Why won't Django 1.0 admin application work?

python - What's the best Django search app?

python - How to skip sys.exitfunc when unhandled exceptions occur

How can I use a DLL file from Python?

MVC model structure in Python

Fetching attachments from gmail via either python or php

Asynchronous Programming in Python Twisted

python - Regular expression to match start of filename and filename extension

python - Effective Keyboard Input Handling

python - How do i generate a histogram for a given probability distribution (for functional testing a server)?

python - PubSub lib for c#

import - Bizarre python ImportError

How to copy a file to a remote server in Python using SCP or SSH?

What are some strategies to write python code that works in CPython, Jython and IronPython

stackless - Good python library for designing a mmo? Actor based design

c# - Btrieve without Pervasive?

python - What is the best way to copy a list?

python - Possible Google Riddle?

user interface - Change command Method for Tkinter Button in Python

python - What is the best way to serve static web pages from within a Django application?

scripting - How do I check out a file from perforce in python?

text - How do I not raise a Python exception when converting an integer-as-string to an int

python - Framework/Language for new web 2.0 sites (2008 and 2009)

python - What's a good resource for starting to write a programming language, that's not context free?

Create a list with initial capacity in Python

script languages on windows mobile - something similar to python @ nokia s60

What are some good Python ORM solutions?

python - How to convert local time string to UTC?

Parsing GPS receiver output via regex in Python

How do you check whether a python method is bound or not?

python - Is it possible to communicate with a sub subprocess with subprocess.Popen?

python - Unittest causing sys.exit()

python - Getting international characters from a web page?

python - How to specify relations using SQLAlchemy declarative syntax?

python - Public free web services for testing soap client

python - Serving dynamically generated ZIP archives in Django

python - How do I get started processing email related to website activity?

python - why might my pyglet vertex lists and batches be very slow on Windows?

python - Truncate a string without ending in the middle of a word

macos - Accidental overwrite of OSX Python system framework

python - Testing GUI code: should I use a mocking library?

Is this the best way to get unique version of filename w/ Python?

python - mod_python/MySQL error on INSERT with a lot of data: "OperationalError: (2006, 'MySQL server has gone away')"

Large Python Includes

ssh - How to scp in Python?

scripting - python as a "batch" script (i.e. run commands from python)

Python Regex - How to Get Positions and Values of Matches

graphics - Pretty graphs and charts in Python

python - How can I use UUIDs in SQLAlchemy?

python - How to check for memory leaks in Guile extension modules?

python - How do I create a new signal in pygtk

windows - Cross-platform space remaining on volume using python

python - Decorating a parent class method

coding style - How to indent Python list-comprehensions?

oop - Is there a benefit to defining a class inside another class in Python?

python - Os.path : can you explain this behavior?

Python ReportLab use of splitfirst/splitlast

python - How to add method using metaclass

python - Admin generic inlines for multi-table subclassed models broken --- any alternatives?

python - What do I need to import to gain access to my models?

python - Lua as a general-purpose scripting language?

Why are SQL aggregate functions so much slower than Python and Java (or Poor Man's OLAP)

bash - Redirect command to input of another in Python

Caching compiled regex objects in Python?

jython - Modern, high performance bloom filter in Python?

python - OPENGL User Interface Programming

Setup Python environment on Windows

How do I set up Vim autoindentation properly for editing Python files?

python - How do I edit and delete data in Django?

python - What's the best way to calculate a 3D (or n-D) centroid?

How to get an absolute file path in Python

python - How can I add post-install scripts to easy_install / setuptools / distutils?

Sending mail from Python using SMTP

python - Cleaning form data in Django

python - Code to verify updates from the Google Safe Browsing API

orm - iBATIS for Python?

Improving Python readability?

'id' is a bad variable name in Python

python - OS X: Determine Trash location for a given path

variadic functions - Passing on named variable arguments in python

python - How do I turn an RSS feed back into RSS?

python - What does BlazeDS Livecycle Data Services do, that something like PyAMF or RubyAMF not do?

Best Python supported server/client protocol?

html - How can I retrieve the page title of a webpage using Python?

python - How to determine if a directory is on same partition

Which is faster, python webpages or php webpages?

vba - Resources for Python Programmer

http - How to write a download progress indicator in Python?

debugging - When to use the Python debugger

model view controller - Python GTK MVC: Kiwi?

Python with PIL and Libjpeg on Leopard

datetime - What is the simplest way to find the difference between 2 times in python?

python - Which of these scripting languages is more appropriate for pen-testing?

python - using rstrip on form.cleaned_data[i] in Django

How do you create a weak reference to an object in Python?

python - When to create a new app (with startapp) in Django?

Translate SVN path to local file system path in Python

Python library to modify MP3 audio without transcoding

python - Undo with GTK TextView

database - Problem opening berkeley db in python

python - Django Sessions

gis - Nice Python wrapper for Yahoo's Geoplanet web service?

python - Virtualenv on Ubuntu with no site-packages

python - wxPython: displaying multiple widgets in same frame

python - Best way to access table instances when using SQLAlchemy's declarative syntax

python - Django -vs- Grails -vs-?

python - How do I install plpython on MacOs X 10.5?

java - Jython 2.2.1, howto move a file? shutils.move is non-existant!

python - py2exe including MSVC DLLs in the .exe

python - How to use form values from an unbound form

How create threads under Python for Delphi

python - XPath search with ElementTree

sysadmin - What Python way would you suggest to check whois database records?

python - Which is the most useful Mercurial hook for programming in a loosely connected team?

python - How do I get the string with name of a class?

python - What is the problem with reduce()?

python - Open source alternative to MATLAB's fmincon function?

Random in python 2.5 not working?

python - Django: Arbitrary number of unnamed urls.py parameters

Is there a way around coding in Python without the tab, indent & whitespace criteria?

python - Styling multi-line conditions in 'if' statements?

Java -> Python?

Is there a common way to check in Python if an object is any function type?

c++ - How does one decrypt a PDF with an owner password, but no user password?

email - Sending mail via sendmail from python

Ignore case in Python strings

python - In the Django admin interface, is there a way to duplicate an item?

How can I unpack binary hex formatted data in Python?

arrays - Can parallel traversals be done in MATLAB just as in Python?

php - Comparing runtimes

How do I convert a list of ascii values to a string in python?

python - How to create a triple-join table with Django

python - What language should I learn as a bridge to C (and derivatives)

database - Store simple user settings in Python

deployment - How do I turn a python program into an .egg file?

python - Tracd Realm

python cgi on IIS

list - fast filter method in python

c# - Python class factory ... or?

python - Is it pythonic for a function to return multiple values?

unit testing - Python's unittest logic

python - How do I remove a cookie that I've set on someone's computer?

Python dictionary from an object's fields

What is MATLAB good for? Why is it so used by universities? When is it better than Python?

algorithm - Average difference between dates in Python

regex - Python and "re"

Amazon API library for Python?

syntax - How do I abort the execution of a Python script?

python - Using the docstring from one method to automatically overwrite that of another method

python - How do you retrieve items from a dictionary in the order that they're inserted?

What is the best way to change text contained in an XML file using Python?

java - OCSP command-line test tool?

How can I port a legacy Java/J2EE website to a modern scripting language (PHP,Python/Django, etc)?

How do I perform an IMAP search in Python (using Gmail and imaplib)?

python - How do I implement a pre-commit hook script in SVN that calls dos2unix to validate checked-in file

import - HTML parser in Python

python - Getting random row through SQLAlchemy

Python, unit-testing and mocking imports

Is there any way to get python omnicomplete to work with non-system modules in vim?

python - How to prompt for user input and read command-line arguments

networking - Embedding a remote Python shell in an application

python regex to match multi-line preprocessor macro

python - A pythonic way to insert a space before capital letters

bootstrapper - Paver 0.8.1 compatibility with python 2.6

mysql - Python Psycopg error and connection handling (v MySQLdb)

python - Glade or no glade: What is the best way to use PyGtk?

arrays - Python: can I have a list with named indices?

python - Get File Object used by a CSV Reader/Writer Object

python - WSGI Middleware recommendations

python - How can I join a list into a string (caveat)?

python - Dealing with a string containing multiple character encodings

setuptools - Accessing python egg's own metadata

Windows Mobile development in Python

python - In Django is there a way to display choices as checkboxes?

python - Docstrings for data?

python - Keeping filters in Django Admin

unicode - Character reading from file in Python

How to start IDLE (Python editor) without using the shortcut on Windows Vista?

python - How to find out whether subversion working directory is locked by svn?

python - Calculate poisson probability percentage

python - Can distutils create empty __init__.py files?

Testing socket connection in Python

python - How to package Twisted program with py2exe?

What's the best dispatcher/callback library in Python?

How do I manipulate bits in Python?

encryption - What's the most pythonic way of access C libraries - for example, OpenSSL?

Alert boxes in Python?

setuptools - How to get the "python setup.py" submit information on freshmeat?

Python Regex vs PHP Regex

linux - Automate firefox with python?

python - Debug Pylons application through Eclipse

2D animation in Python

python - How to retrieve an element from a set without removing it?

python - When is "self" required?

How can I compress a folder and email the compressed file in Python?

python - How do I develop and create a self-contained PyGTK application bundle for MacOS, with native-looking widgets?

python - Django VMware appliance

python - Drawing with Webdings in PIL

Storing multiple arrays in Python

Python - sort a list of nested lists

python - How can i parse a comma delimited string into a list (caveat)?

python - Fixed-point arithmetic

python - How to access the user profile in a Django template?

python - How do I write a decorator that restores the cwd?

debugging - Debug/Monitor middleware for python wsgi applications

python - Difflib.SequenceMatcher isjunk optional parameter query: how to ignore whitespaces, tabs, empty lines?

python - email body from a parsed email object in jython

How can the user communicate with my python script using the shell?

Now that Python 2.6 is out, what modules currently in the language should every programmer know about?

python - In Django, where is the best place to put short snippets of HTML-formatted data?

linux - Python script to list users and groups

zip - Set permissions on a compressed file in python

python - How to get Django AutoFields to start at a higher number

regex - I'm using Python regexes in a criminally inefficient manner

web crawler - What are the best prebuilt libraries for doing Web Crawling in Python

How to find all built in libraries in Python

Python - How do I convert "an OS-level handle to an open file" to a file object?

windows - Create an icon in memory with win32 in python

python - PyOpenGl or pyglet?

Can you do LINQ-like queries in a language like Python or Boo?

Do you use the "global" statement in Python?

memory - Running unexported .dll functions with python

Pure Python rational numbers module for 2.5

shell - Using os.execvp in Python

How do I use timezones with a datetime object in python?

python - How can one get the set of all classes with reverse relationships for a model in Django?

math - Python: unsigned 32 bit bitwise arithmetic

formatting - What's the Name of the Python Module that Formats arbitrary Text to nicely looking HTML?

syntax - In Python, how I do use subprocess instead of os.system?

python - How do I successfully pass a function reference to Django’s reverse() function?

python - long <-> str binary conversion

user interface - making a python GUI

Cursor event handling in python+Tkinter

How do I get a decimal value when using the division operator in Python?

How do I enable push-notification for IMAP (Gmail) using Python imaplib?

python - How do I build and install P4Python for Mac OS X?

Python scope: "UnboundLocalError: local variable 'c' referenced before assignment"

installation - Distributing a stand-alone Python web-based application to non-technical users

c# - Text difference algorithm

setuptools - python setup.py develop not updating easy_install.pth

python - py3k RC-1: "LookupError: unknown encoding: uft-8"

python - How to update a Tix.ComboBox's text?

python - Initializing cherrypy.session early

Python: How do I generate a keypress?

python - Migrating from CPython to Jython

http - Python and POST data

Advanced Python FTP - can I control how ftplib talks to a server?

python - Django: How do I create a generic url routing to views?

python - Import a module from a relative path

python curses.ascii depending on locale?

macos - python install on leopard

user interface - Something like Explorer's icon grid view in a Python GUI

Python for C++ Developers

import - What is the scope for imported classes in python?

Tutorial for Python - Should I use 2.x or 3.0?

pdf generation - Can anyone recommend a decent FOSS PDF generator for Python?

naming - Deploying a python application with shared package

Naming conventions in a Python library

active directory - How to Retrieve name of current Windows User (AD or local) using Python?

Python vs. Ruby for metaprogramming

python - Automated Class timetable optimize crawler?

python - How can I make a dictionary from separate lists of keys and values?

winapi - Setting monitor power state in python?

python - How do I search for unpublished Plone content in an IPython debug shell?

What is best way to remove duplicate lines matching regex from string using Python?

Best practices for manipulating database result sets in Python?

variables - How to maintain lists and dictionaries between function calls in Python?

windows - How to script an OLE component using Python

Python PostgreSQL modules. Which is best?

macos - How do you create an osx application/dmg from a python package?

bash - How do I enter a pound sterling character (£) into the Python interactive shell on Mac OS X?

python - Dictionary or If statements, Jython

winapi - Monitoring a displays state in python?

python - How would a system tray application be accomplished on other platforms?

regex - python regular expression to split paragraphs

python - Significant figures in the decimal module

linux - Howto do python command-line autocompletion but NOT only at the beginning of a string

javascript - Issue With Python Sockets: How To Get Reliably POSTed data whatever the browser?

python - Grabbing text from a webpage

Extracting text from HTML file using Python

Has anyone found a good set of python plugins for vim -- specifically module completion?

How to implement common bash idioms in Python?

python - Is there a more Pythonic way to merge two HTML header rows with colspans?

python - Removing a subset of a dict from within a list

python - How can you determine a point is between two other points on a line segment?

Anyone know of a good Python based web crawler that I could use?

Is there any difference between "string" and 'string' in Python?

Is there a good Python GUI shell?

python - Using Pylint with Django

c++ - How to expose std::vector<int> as a Python list using SWIG?

python - How to make a surface with a transparent background in pygame

scripting - What would be the simplest way to daemonize a python script in Linux?

python - Create a List that contain each Line of a File

python - Why do I receive an ImportError when running one of the CherryPy tutorials

cryptography - Crypto/X509 certificate parsing libraries for Python

Finding a public facing IP address in Python?

Exposing a C++ API to Python

Convert mysql timestamp to epoch time in python

multithreading - Python Threads - Critical Section

python - Scripting language choice for initial performance

python - How to raise an exception on the version number of a module

How to import a python file in python script more than once

encoding - How to base64 encode a PDF file in Python

OCSP libraries for python / java / c?

Recommended Python publish/subscribe/dispatch module?

python - wxpython: Updating a dict or other appropriate data type from wx.lib.sheet.CSheet object

python - Clearing a list

python - Pythonic equivalent of unshift or redo?

python - Django, mod_python, apache and wacky sessions

python - Can you achieve a case insensitive 'unique' constraint in Sqlite3 (with Django)?

python - How do I modify the last line of a file?

Drag and drop onto Python script in Windows Explorer

Converting PDF to HTML with Python

python - How to make Apache/mod_python process collect its zombies?

deployment - How to build and deploy Python web applications

python - Which is more pythonic, factory as a function in a module, or as a method on the class it creates?

Are there any graph/plotting/anything-like-that libraries for Python 3.0?

python - how to draw lines on a picture background in pygame

python - How to enable MySQL client auto re-connect with MySQLdb?

python - How can I capture all exceptions from a wxPython application?

bit fields - Does Python have a bitfield type?

python - What is the simplest way to offer/consume web services in jython?

Syntax error whenever I put Python code inside a Django template

Python module that implements ftps

How do I upgrade python 2.5.2 to python 2.6rc2 on ubuntu linux 8.04?

python - Sleeping in a batch file

How can I convert XML into a Python object?

python - How to show the visitor a moved web page AND return a 301 redirect HTTP response status code in Django?

How can I consume a WSDL (SOAP) web service in Python?

python - Django equivalent for count and group by

debugging - Is there a free python debugger that has watchpoints?

monitoring - CPU Usage Per Process in Python

How to check that a path has a sticky bit in python?

python - Read the last lineof the file

Why does Python's string.printable contains unprintable characters?

What's a cross platform way to play a sound file in python?

Is a Python dictionary an example of a hash table?

Are there any IDE's that support Python 3 syntax?

windows xp - Process size in XP from Python

animation - What is the fastest way to scale and display an image in Python?

python - Suggestion to implement a text Menu without switch case

oop - Python object attributes - methodology for access

python - Where can a save confirmation page be hooked into the Django admin? (similar to delete confirmation)

python - Is there a library similar to pyparsing in Java?

parsing - Extracting a parenthesized Python expression from a string

Python: C++-like stream input

Detecting Mouse clicks in windows using python

dictionary - Storing and updating lists in Python dictionaries: why does this happen?

windows - How can I use Numerical Python with Python 2.6

networking - List of IP addresses/hostnames from local network in Python

storing unbound python functions in a class object

python - How would I package and sell a Django app?

python - Hooking up GUI interface with asynchronous (s)ftp operation

How do I dump an entire Python process for later debugging inspection?

python - Programmatically launching standalone Adobe flashplayer on Linux/X11

Remote debugging of multi threaded Python Applications

python - Change Django Templates Based on User-Agent

python - Deploying Django: How do you do it?

deployment - How do I deploy a Python desktop application?

Socket programming for mobile phones in Python

Help with <key> event in python Entry widget

macos - Why is the Python readline module not available on OS X?

user interface - WPF Alternative for python

Is there a function in python to split a word into a list?

Is there a function in Python to split a string without ignoring the spaces?

python - Can "list_display" in a Django ModelAdmin display attributes of ForeignKey fields?

python - How to overload __init__ method based on argument type?

python - Is there an easy way to populate SlugField from CharField?

Ruby to Python bridge

Memory Efficient Alternatives to Python Dictionaries

python - Apache sockets not closing?

How do I wrap a string in a file in Python?

oop - Python-passing variable between classes

apache user can not write to .python-eggs

python - How do I use owfs to read an iButton temperature logger?

Python distutils and replacing strings in code

How can I create a status bar item with Cocoa and Python (PyObjC)?

signals - What are the Python equivalents of the sighold and sigrelse functions found in C?

class - Why do attribute references act like this with Python inheritance?

python - Is there a "one-liner" way to get a list of keys from a dictionary in sorted order?

python - How to add an automatic filter to a relation with SQLAlchemy?

How do I find what is using memory in a Python process in a production system?

python - variables as parameters in field options

python - Multiple Django Admin Sites on one Apache... When I log into one I get logged out of the other

python - urllib2 file name

Writing to the windows logs in Python

python - @Rails users: have you tried web2py? Pros? Cons?

Django and Python 2.6

filesystems - How to list only top level directories in Python?

python - Attribute BOLD doesn't seem to work in my curses

python - Any good team-chat websites?

python - How to create a picture with animated aspects programmatically

Looking for File Traversal Functions in Python that are Like Java's

Python - When to use file vs open

validation - How can I check the syntax of Python code in Emacs without actually executing it?

python - Subclassing a class with private members

vb.net - scripting fruityloops or propellerheads reason from VB or Python?

performance - Which is faster in Python: x**.5 or math.sqrt(x)?

post - How would one log into a phpBB3 forum through a Python script using urllib, urllib2 and ClientCookie?

python - Interface to versioned dictionary

Starting a new database driven python web application would you use a javascript widget framework? If so which framework?

How would you implement ant-style patternsets in python to select groups of files?

authentication - Authenticating against active directory using python + ldap

console application - using curses with raw_input in python

smtp - Using Python's smtplib with Tor

python - Sometimes can't delete an Oracle database row using Django

python - Library for converting a traceback to its exception?

python - Running unit tests on nested functions

module - Is it possible to compile Python natively (beyond pyc byte code)?

python - How do I use genshi.builder to programmatically build an HTML document?

python - Capture the contents of a regex and delete them, efficiently

Something similar to PHP's SimpleXML in Python?

internationalization - Using locale.setlocale in embedded Python without breaking file parsing in C thread

python - Django admin site not displaying ManyToManyField relationship

mysql - Setting up a Python web development environment on OS X

python - Regular expressions but for writing in the match

php - What would you recommend for a high traffic ajax intensive website?

python - List all words in a dictionary that start with <user input>

reflection - How can I dynamically get the set of classes from the current python module?

python - Any experience with the Deliverance system?

python - Writing a Domain Specific Language for selecting rows from a table

What is the fastest way to draw an image from discrete pixel values in Python?

python - Why results of map() and list comprehension are different?

python - Does anyone know of a widget for a desktop toolkit(GTK, Qt, WX) for displaying a map of US states?

python - Converting a string of 1's and 0's to a byte array

Emulation of lex like functionality in Perl or Python

For Python support, what company would be best to get hosting from?

python - Adding Cookie to ZSI Posts

python - Failed to get separate instances of a class under mod_python

python - Django Forms, Display Error on ModelMultipleChoiceField

python - How do I overlap widgets with the Tkinter pack geometry manager?





top