Python Patterns & Practices

Find The Best Answers To Your Python Coding Problems



exception - Checking for member existence in Python

python - How do I process a string such as this using regular expressions?

php - Best language choice for a spam detection service

python - HTTP Request Timeout

python - Installing certain packages using virtualenv

python - PyQt - QScrollBar

python - array.array versus numpy.array

What is "lambda binding" in Python?

winapi - Alert Popups from service in Python

python - Why the Global Interpreter Lock?

Packaging a Python library

dictionary - Comparing dictionaries in Python

python - How do I test a django database schema?

Python - one variable equals another variable when it shouldn't

python - using jython and open office 2.4 to convert docs to pdf

ftp - Using Python's ftplib to get a directory listing, portably

deployment - Are there any other good alternatives to zc.buildout and/or virtualenv for installing non-python dependencies?

Vim extension (via Python)?

Does python support multiprocessor/multicore programming?

python - How do I construct the packets for this UDP protocol?

python - How do I determine if an email is Base64 encoded?

java - JFileChooser for Python?

setting the gzip timestamp from Python

python - JDBC & MSSQL seem to be truncating large fields

Shorthand adding/appending in Python

Is there any way to do HTTP PUT in python

Django/Python - Grouping objects by common set from a many-to-many relationships

django - How do I get python-markdown to additionally "urlify" links when formatting plain text?

unicode - Python: Use the codecs module or use string function decode?

c# - Can Regex be used for this particular string manipulation?

How can I support wildcards in user-defined search strings in Python?

python - Strategies for speeding up batch ORM operations in Django

Analyse python list with algorithm for counting occurences over date ranges

Getting attributes of a Python package that I don't have the name of, until runtime

python - Receive socket size limits good?

python - Partial evaluation for parsing

python - Is late binding consistent with the philosophy of "readibility counts"?

c - Is it feasible to compile Python to machine code?

dictionary - What is the equivalent of map<int, vector<int> > in Python?

c++ - Is Python and pygame a good way to learn SDL?

Which is the best way to get a list of running processes in unix with python?

I need a really good reason to use Python

windows - Creating self-contained python applications

python - Filtering a complete date in django?

python - Match unicode in ply's regexes

python - Model limit_choices_to={'user': user}

.net - IronPython vs. C# for small-scale projects

python - Problem with Boolean Expression with a string value from a lIst

Python-Regex, what's going on here?

xml - Pure Python XSLT library

svn - Is there a windows implementation to python libsvn?

recursion - Python: using a recursive algorithm as a generator

python name a file same as a lib

vcf vcard - Python Library to Generate VCF Files?

functional programming - Pattern matching of lists in Python

What is the difference between Ruby and Python versions of"self"?

sqlite - Python pysqlite not accepting my qmark parameterization

Python 3.0 `wsgiref` server not functioning

python - Is there something between a normal user account and root?

python - urllib.urlopen works but urllib2.urlopen doesn't

python - how to pass id from url to post_save_redirect in urls.py

algorithm - Shortest Sudoku Solver in Python - How does it work?

Python Web Services

python - split twice in the same expression?

python - Django workflow when modifying models frequently?

python - Is it possible to get the value of an item contained in Django's "changed_data" list?

python - How do you log server errors on django sites

python - Column comparison in Django queries

What is the naming convention in Python for variable and function?

python - Deleting multiple elements from a list

python - Which GTK widget combination to use for scrollable column of widgets?

python - Refactoring "to hit" values for a game

python - How do I add a custom inline admin widget in Django?

c# - How to analyse .exe parameters inside the program?

Shuffle an array with python, randomize array item order with python

scripting - How can I launch an instance of an application using Python?

python - Formatting dict.items() for wxPython

internationalization - Python's os.path choking on Hebrew filenames

python - Nginx + fastcgi truncation problem

python - Daylight savings time change affecting the outcome of saving and loading an icalendar file?

How do I add tab completion to the Python shell?

python - What's the difference between all of the os.popen() methods?

Is there a Python equivalent of Perl's x operator (replicate string)?

How to find out if there is data to be read from stdin on Windows in Python?

metaprogramming - Best way to create a "runner" script in Python?

How do you get the logical xor of two variables in Python?

python - How do you get a thumbnail of a movie using IMDbPy?

python - file upload status information

python - Progress bar not updating during operation

parsing - How do I parse a listing of files to get just the filenames in Python?

What's a good way to keep track of class instance variables in Python?

python - How to assign a new class attribute via __dict__?

How do you create a daemon in Python?

python - Database change underneath SQLObject

How can I draw a bezier curve using Python's PIL?

internationalization - Can I call and set the Python gettext module in a library and a module using it at the same time?

Materials for SICP with python?

python - Is there any case where len(someObj) does not call someObj's __len__ function?

python properties and inheritance

mysql - information seemingly coming out of mysqldb incorrectly, python django

python - When printing an image, what determines how large it will appear on a page?

python - Django Admin app or roll my own?

python - How to disable HTML encoding when using Context in django

python - HTTP compliance testing

Python's version of PHP's time() function

python - Check if a given key already exists in a dictionary and increment it

Global hotkey for Python application in Gnome

How do I perform HTML decoding/encoding using Python/Django?

python - How do you programmatically reorder children of an ATFolder subclass?

optimization - When is not a good time to use python generators?

Any python libs for parsing apache config files?

Binary data with pyserial(python serial port)

python - What is the regular expression for /urlchecker/http://www.google.com

http - Python: urllib/urllib2/httplib confusion

python - How to update turbogears application production database

python - Upload a file in Django and then send it somewhere else through REST?

Get rid of '\n' in Python

python - Multiple mouse pointers?

python - Subtract from an input appended list with a running balance output

python - Convert a string with date and time to a date

Confusion about global variables in python

python - config_vars.mk missing in default xampp-linux installation

java - Which language is easiest and fastest to work with XML content?

django - Refactor this Python code to iterate over a container

python - TypeError: 'tuple' object is not callable

How do I get the name of a function or method from within a Python function or method?

How to copy a file in Python with a progress bar?

Any python libs for parsing Bind zone files?

xml rpc - HOWTO: XML-RPC dynamic function registration in python?

UTF-8 latin-1 conversion issues, python django

java - loadComponentFromURL falls over and dies, howto do CPR?

python - Running Django with FastCGI or with mod_python

python - How to specify uniqueness for a tuple of field in a Django model

java - Which library should I use to write an XLS from Linux / Python?

File and space in Python

python - How to read the header with pycurl

How do I convert any image to a 4-color paletted image using the Python Imaging Library?

python - What are "first-class" objects?

python - How do I resize an image using PIL and maintain its aspect ratio?

refactor this dictionary-to-xml converter in python

Incorrect answer in dll import in Python

How can I use Python for large scale development?

oop - How do I Create an instance of a class in another class in Python

Quoting backslashes in Python string literals

How to unquote a urlencoded unicode string in python?

python - Porting MATLAB functions to Scilab. How do I use symbolic?

url - Create a cross-platform protocol helper that runs a python script

exception - Is there a cross-platform way of getting information from Python's OSError?

python - What is your convention to distinguish between object methods to be called by the outside, and object methods to be called by a subclass?

python - Why is fuse not using the class supplied in file_class

python - Is it possible to bind an event against a menu instead of a menu item in wxPython?

How to convert XML to JSON in Python?

python - AJAX console window with ANSI/VT100 support?

Are there any web based email clients written in python?

python - check at the end of the loop if need to run again

gdb - Environment Variables in Python on Linux

Calling Java (or python or perl) from a PHP script

Python 3.0 and language evolution

How can I disable quoting in the Python 2.4 CSV reader?

python - opengl set texture color with vertex color

Way to have compiled python files in a separate folder?

encoding - how do I implement a custom code page used by a serial device so I can convert text to it in Python?

Access second result set of stored procedure with SQL or other work-around? Python\pyodbc

python - Trailing slashes in Pylons Routes

python - Pros and cons of IronPython and IronPython Studio

python - Map two lists into one single list of dictionaries

debugging - What are good ways to make my Python code run first time?

scripting - With Lua and Python embeddable, is there a place for Basic?

Python/Twisted multiuser server - what is more efficient?

retrieving current URL from FireFox with python

python - Default parameters to actions with Django

python - Which Eclipse package should I download for PyDev?

php - Solving the shared-server security problem for Python

python - Uses for Dynamic Languages

java - Testing Web Services Consumer

How do I merge two python iterators?

Validating with an XML schema in Python

python - Customizing an Admin form in Django while also using autodiscover

How to copy all properties of an object to another object, in Python?

Which Python module is suitable for data manipulation in a list?

linux - Python memory debugging with GDB

How do I change directory back to my original working directory with Python?

Splitting strings in python

design patterns - Open source examples of well designed Python applications

Unicode block of a character in python

How can I get my python (version 2.5) script to run a jar file inside a folder instead of from command line?

perl - Is there a Term::ANSIScreen equivalent for Python?

soap - Generating a WSDL using Python and SOAPpy

mingw - Python Distutils

python - Outputting to a text file

python - How do lexical closures work?

python - Including a dynamic image in a web page using POST?

python - Organising a GUI application

Python's os.execvp equivalent for PHP

Python xml.dom.minidom.parse() function ignores DTDs

python - Set PYTHONPATH in Emacs on MacOS?

text parsing - What's the best way(error proof / foolproof) to parse a file using python with following format?

Cannot import SQLite with Python 2.6

debugging - Starting python debugger automatically on error

python - "File -X: does not exist" message from ipy.exe in Windows PowerShell

What is the best way to extract load average float values from a string in Python?

python - Form (or Formset?) to handle multiple table rows in Django

python - How do I restrict foreign keys choices to related objects only in django

algorithm - Python: For each list element apply a function across the list

How does one add a svn repository build number to Python code?

visual studio 2008 - Code Coverage and Unit Testing of Python Code

compilation - Why compile Python code?

python - User Authentication in Django

python - Looping in Django forms

python - In Django, how do you retrieve data from extra fields on many-to-many relationships without an explicit query for it?

How to do Makefile dependencies for python code

Python + Leopard + Fink + Mac Ports + Python.org + Idiot = broken Python - fresh start?

python - How do I remove VSS hooks from a VS Web Site?

serialization - How to serialize Python objects in a human-readable format?

java - Jython and python modules

OpenGl with Python

python - How to scan a webpage and get images and youtube embeds?

python - How to compare and search list of integers efficiently?

python - Is there any way to get a REPL in pydev?

python - Catch MainLoop exceptions and displaying them in MessageDialogs

python - Will Django be a good choice for a permissions based web-app?

python - How to make the keywords recognizable in simpleparse?

email - ISO encoded attachment names and python

python - How should I stress test / load test a client server application?

python - SUDS - programmatic access to methods and types

java - python (jython) archiving library

What's the best python soap stack for consuming Amazon Web Services WSDL?

python - how to tell if a string is base64 or not

python - Framework/CMS suggestions for enterprise website & intranet (I've got to convince the president its solid!)

python - Why does 1+++2 = 3?

python - Convert CVS/SVN to a Programming Snippets Site

python - Interactive console using Pydev in Eclipse?

python - Dynamically update ModelForm's Meta class

Python inheritance - how to disable a function

python - How to produce a 303 Http Response in Django?

python - I want a program that writes every possible combination to a different line of a text file

java - Linking languages

python - problem using an instance in a with_statement

python - In Windows, how can I enumerate and get text from another window's controls?

python - Reading collections of extended elements in an RSS feed with Universal Feed Parser

Remove C and C++ comments using Python?

python - deleting rows of a numpy array based on uniqueness of a value

python - How does one add default (hidden) values to form templates in Django?

Python Outlook 2007 COM primer

eclipse - Integrating command-line generated python .coverage files with PyDev

testing - Practicing BDD with python

python - Single Table Inheritance in Django

Prevent Python subprocess from passing fds on Windows?

language features - is there an alternative way of calling next on python generators?

How can I listen for 'usb device inserted' events in Linux, in Python?

Given a list of variable names in Python, how do I a create a dictionary with the variable names as keys (to the variables' values)?

how do i use python libraries in C++?

python - Django - How to do tuple unpacking in a template 'for' loop

In Python - how to execute system command with no output

python - adding scrollbars to pythoncard application

Python lazy list

A generic priority queue for Python

scripting - Make python enter password when running a csh script

java - Performance comparison of Thrift, Protocol Buffers, JSON, EJB, other?

python - using django-rest-interface with http put

django - Any Python OLAP/MDX ORM engines?

bit manipulation - Python: Set Bits Count (popcount)

python - How can I apply authenticated proxy exceptions to an opener using urllib2?

file - How do I zip the contents of a folder using python (version 2.5)?

How do I remove a specific number of files using python (version 2.5)?

python - How to vertically align Paragraphs within a Table using Reportlab?

python - Any good "contact us" recipes for Cherrypy?

python - In Django how do i return the total number of items that are related to a model?

post - Python urllib2 file upload problems

Anyone using Python for embedded projects?

python - post_save signal on m2m field

python - Identifying numeric and array types in numpy

networking - Python - Library Problems

python - How do I determine all of my IP addresses when I have multiple NICs?

python - Templates within templates. How to avoid rendering twice?

Which is more efficient in Python: standard imports or contextual imports?

c++ - How to synchronize the same object on client and server side in client-server application? Is small messages framework good for this job?

url - Python Find Question

python - Tkinter: invoke event in main loop

Python/Twisted - TCP packet fragmentation?

datetime - Python's timedelta: can't I just get in whatever time unit I want the value of the entire difference?

Is there a standalone Python type conversion library?

python - PyQt: getting widgets to resize automatically in a QDialog

How do I copy files with specific file extension to a folder in my python (version 2.5) script?

How do I validate xml against a DTD file in Python

python - How to intercept special (alt / ctrl) key press?

python - Can I log into a web application automatically using a users windows logon?

python - os.walk without digging into directories below

Ruby equivalent of Python's "dir"?

django - Does anyone know of a python based web ui for snmp monitoring?

Does python optimize modules when they are imported multiple times?

Why does Ruby have Rails while Python has no central framework?

django - How do you create python methods(signature and content) in code?

scripting - Python code for sorting files into folders

c# - What is a partial class?

Can I use IPython in an embedded interactive Python console?

C++ string diff (a la Python's difflib)

parsing - Python: convert alphabetically spelled out numbers to numerics?

python - WindowsError: priveledged instruction when saving a FreeImagePy Image in script, works in IDLE

python - In Django, how does one filter a QuerySet with dynamic field lookups?

python - Floating Point Limitations

How do I iterate through a string in Python?

python - Passing JSON strings larger than 80 characters

Tracking file load progress in Python

Python file interface for strings

Flattening a shallow list in Python

python - How to get hex string from signed integer

Python Input/Output, files

python - What's the best serialization method for objects in memcached?

debugging - Python debugger: Stepping into a function that you have called interactively

winapi - Modifying Microsoft Outlook contacts from Python

unit testing - How can one mock/stub python module like urllib

python - Regular expression to extract URL from an HTML link

python - How can I call a DLL from a scripting language?

python - Adding a dimension to every element of a numpy.array

python - How do I add a directory with a colon to PYTHONPATH?

windows - Passing arguments with wildcards to a Python script

What's win32con module in python? Where can I find it?

Using Python to authenticate against raw username, hash, salt in DB created by ASP.NET roles/membership

python ide vs cmd line detection?

python - Minimal, Standalone, Distributable, cross platform web server

python - How do you compile wxPython under cygwin?

python - How can I Cause a Deadlock in MySQL for Testing Purposes

openoffice.org - getting pywin32 to work inside open office 2.4 built in python 2.3 interpreter

insert two values from an mysql table into another table using a python program

python - Is Django a good choice for a security critical application?

regex - How can I translate the following filename to a regular expression in Python?

python - Convert a string to preexisting variable names

python - Django Model returning NoneType

urllib2 - Accepting File Argument in Python (from Send To context menu)

python - Valid use case for django admin?

http - What mime-type should I return for a python string

python - Your most unpythonic code snippet

c++ - How do I compile a Visual Studio project from the command-line?

linux - Python - Setting / Getting Environment Variables and Addrs

python - What is a cyclic data structure good for?

python - Inplace substitution from ConfigParser

Use Python 2.6 subprocess module in Python 2.5

How to make python gracefully fail?

email - Is there a Python library function which attempts to guess the character-encoding of some bytes?

python - PYTHONSTARTUP doesn't seem to work

sql - How to quote a string value explicitly (Python DB API/Psycopg2)

performance - How do I count bytecodes in Python so I can modify sys.setcheckinterval appropriately

How can I reference columns by their names in python calling SQLite?

How do python classes work?

Is there a Python news site that's the near equivalent of RubyFlow?

How do I set up Setuptools for Python 2.6 on Windows?

python - Missing first line when downloading .rar file using urllib2.urlopen()

python - Is there a known Win32 Tkinter bug with respect to displaying photos on a canvas?

python - Pycurl WRITEDATA WRITEFUNCTION collision/crash

python - Adding a generic image field onto a ModelForm in django

python - How can you emulate a mailing list in Django?

dictionary - Is there a fast way to generate a dict of the alphabet in Python?

editor - Komodo Edit and Notepad++ ::: Pros & Cons ::: Python dev

Writing a TTL decorator in Python

datetime - What's the best way to make a time from "Today" or "Yesterday" and a time in Python?

python - Access CVS through Apache service using SSPI

What is the best way to distribute a python program extended with custom c modules?

performance - Sample a running Python app

multiple inheritance - Why can't I inherit from dict AND Exception in Python?

documentation - "Interfaces" in Python: Yea or Nay?

In what situation should the built-in 'operator' module be used in python?

python - Replacing multiple occurrences in nested arrays

Extract ipv6 prefix in python

python - Queryset API distinct() does not work?

python - Flattening one-to-many relationship in Django

Implement Blackjack in Python

python - PyGame not receiving events when 3+ keys are pressed at the same time

Permutations in python, with a twist

python - How to stop BaseHTTPServer.serve_forever() in a BaseHTTPRequestHandler subclass?

python - pygtk glade question: why isn't this simple script working?

python - What is the regular expression for the "root" of a website in django?

Is it required to learn Python 2.6 along with Python 3.0?

scope - Getting "global name 'foo' is not defined" with Python's timeit

python - Writing a simple "Rock Paper Scissors" game bot

xml rpc - Web based wizard with Python

What is the best way to geotag jpeg-images with python?

c++ - What are some techniques for code generation?

What GUI toolkit looks best for a native LAF for Python in Windows and Linux?

Is there a Perl equivalent of Python's re.findall/re.finditer (iterative regex results)?

python - Getting key with maximum value in dictionary?

optimization - Python data structures overhead/performance

python - Django Project structure, recommended structure to share an extended auth "User" model across apps?

applescript - Translating Python Regexp to Shell

Python or Ruby for a .NET developer?

python - Advice regarding IPython + MacVim Workflow

networking - Python UPnP/IGD Client Implementation?

python - Regular Expressions in unicode strings

ftp - Is there a special trick to downloading a zip file and writing it to disk with Python?

python - Multiple database support in django

python - Adding REST to Django

c++ - Deploying application with Python or another embedded scripting language

installation - Install MySQLdb (for python) as non-compressed egg

linux - How do I find userid by login (Python under *NIX)

Lambda function for classes in python?

python - What is the practical difference between xml, json, rss and atom when interfacing with Twitter?

parsing - Implementing a "rules engine" in Python

How to convert rational and decimal number strings to floats in python?

Showing processing message in Python

Sorting dictionary keys in python

python runtime error, can dump a file?

How can I read system information in Python on Windows?

macos - How can I read system information in Python on OS X?

Does python have an equivalent to Java Class.forName()?

input - How to obtain the keycodes in Python

Split HTML after N words in python

python - help me translate Java code making use of bytes into jython code

python, dictionary and int error

python - What is the best way to handle a bad link given to BeautifulSoup?

python - How to prevent overwriting an object someone else has modified

optimization - Why not always use psyco for Python code?

python - Comparing List of Arguments to it self?

python - Why do new instances of a class share members with other instances?

Cross-platform way to get PIDs by process name in python

python - Favorite Django Tips & Features?

java - XML instance generation from XML schema (xsd)

python - How do I create a list of lambdas (in a list comprehension/for loop)?

python: list comprehension tactics

python - Succesive calls to cProfile/pstats no updating properly

How can I unload a DLL using ctypes in Python?

function pointers in python

Study Objective-C , Ruby OR Python?

printing - overload print python

python - What is the sqlalchemy equivalent column type for 'money' and 'OID' in Postgres?

How does python close files that have been gc'ed?

How will Python and Ruby applications be affected by .NET?

windows - Execute Commands Sequentially in Python?

Create plugins for python standalone executables

macos - What does this Python message mean?

Quick primer on implementing a COM object that implement some custom IDLs in python?

python, set terminal type in pexpect

python - A SuggestBox for wxPython?

Python piping on Windows: Why does this not work?

python - Django foreign key access in save() function

serial port - XMODEM for python

python - py2exe to generate dlls?

python - portable non-relational database

python - reading/writing xmp metadatas on pdf files through pypdf

python - How do I disable PythonWin's “Redirecting output to win32trace remote collector” feature without uninstalling PythonWin?

installation - How can I test that I have a Python module successfully installed?

web - How can I provide safety template for user to modify with python?

java - log4j with timestamp per log entry

How can I return system information in Python?

What are the benefits of using Python for web programming?

file - With Python, how can I ensure that compression of a folder takes place within a particular folder?

python - Generating unique, ordered Pythagorean triplets

python - Can I use chart modules with wxpython?

python - Django Model API reverse lookup of many to many relationship through intermediary table

module to create python object representation from xml

class - Does Python have something like anonymous inner classes of Java?

python - Why do I have to specify my own class when using super(), and is there a way to get around it?

namespaces - Does python have something like C++'s using keyword?

Python object.__repr__(self) should be an expression?

Why doesn't Python release file handles after calling file.close()?

Problem with Python implementation of Conway's Game of Life

python - How can I set it up so that threads communicate they're complete with their task?

python - How can I get a list of the running applications with GTK?

python - How can you extract all 6 letter Latin words to a list?

A small question about python's variable scope

python - How can I randomly select an item from a list?

python - How can I install the Beautiful Soup module on the Mac?

What is the recommended way to use Vim folding for Python code

What causes Python socket error?

Include html part in a mail with python libgmail

python - Parsing "From" addresses from email text

sockets - Proper way of cancelling accept and closing a Python processing/multiprocessing Listener connection

python - How can I generate multi-line build commands?

python - Creating a gradient fill in a PDF file using reportlab

Python: How to ignore an exception and proceed?

reflection - Python decorator makes function forget that it belongs to a class

Python and Bluetooth/OBEX

python - Pexpect, running ssh-copy-id is hanging when trying to spawn a second process

python - How can I hide the console window in a PyQt app running on Windows?

oop - Making a method private in a python subclass

Python extend with an empty list bug?

How to handle constructors or methods with a different set (or type) of arguments in Python?

python - Has anyone used SciPy with IronPython?

python - What is the correct way to backup ZODB blobs?

python - How to make a model instance read-only after saving it once?

reflection - In Python, how can you get the name of a member function's class?

loops - What's the most efficient way to access sibling dictionary value in a Python dict?

parsing - How would you parse indentation (python style)?

macos - How to determine number of files on a drive with Python?

user interface - Delphi-like GUI designer for Python

Python regex findall numbers and dots

python - Simple unique non-priority queue system

python - One view ( frontpage ) for many controllers (sub views)

python - Appropriate location for my application's cache on Windows

python - What is a simple way to generate keywords from a text?

Cookie Problem in Python

Python 3.0 smtplib

Minimal Python build for my application's scripting needs?

python - How do you deploy your WSGI application? (and why it is the best way)

Python printing the word

python - Deleting lines from wx.TextCtrl

In the windows python console, how to make Tab = four spaces?

python - How do I make IPython organize tab completion possibilities by class?

python - Docs for the internals of CPython Implementation

Python Path

sqlite - List of tables, db schema, dump etc using the Python sqlite3 API





top