Python Patterns & Practices

Find The Best Answers To Your Python Coding Problems



python - How to store arbitrary number of fields in django model?

python - How do I forbid easy_install from zipping eggs?

python - Finding the coordinates of tiles that are covered by a rectangle with x,y,w,h pixel coordinates

python - How can I determine the monitor refresh rate?

python - ImportError: DLL load failed : - when trying to import psycopg2 library

why does this python program print True

python - PyOpenGL + Pygame capped to 60 FPS in Fullscreen

python - How can I create bound methods with type()?

python - Extracting the To: header from an attachment of an email

python - Generating a graph with multiple (sets of multiple sets of multiple) X-axis data sets

parsing - Haskell equivalent of Python's "Construct"

python - How to store an IP in mySQL

python - Remove the "Add" functionality in Django admin

python - Hook into and log "everything" in the windows message queue

Reverting a Python/Cocoa project to use the default OSX 10.5 Python (2.5)

string - In Python 2.4, how can I strip out characters after ';'?

python - Returning Matplotlib image as string

python - How to setup mod_python configuration variables?

python - Multiple blocks of same name in Jinja2

python - How to explicitly specify a path to Firefox for Selenium?

windows - CheckedListBox used from Python(pywin32)

Optimal way to replace characters in large string with Python?

How to do Obj-C Categories in Python?

python - Django hitting MySQL even after select_related()?

python - is it possible to add an element to a list and preserve the order

python - Create properties using lambda getter and setter

How do I read a date in Excel format in Python?

How to Replace a column in a CSV file in Python?

How to include a python .egg library that is in a subdirectory (relative location)?

random - Can anyone explain this strange python turtle occurance?

java - Is LINQ (or linq) a niche tool, or is it on the path to becoming foundational?

python - how to overwrite User model

python - Qt QFileDialog QSizePolicy of sidebar

How to convert a nested Python dict to object?

Differences between Smalltalk and python?

Basic tree in Python with a Django QuerySet

MySQL LOAD DATA LOCAL INFILE example in python?

ruby - How to delete entries in a dictionary with a given flag in python?

python - In GTK on Windows, how do I change the background color of the whole app?

mysql - Where are Man -pages for the module MySQLdb in Python?

Calling a base class's classmethod in Python

windows - How can I extract the call graph of a function from Python source files?

python - Sorting a dictionary with lists as values, according to an element from the list

eclipse - python 3.1 with pydev

file io - Is there a FileIO in Python?

python - backport function modifiers to python2.1

python - django binary (no source code) deployment

How does mercurial work without Python installed?

python - limit downloaded page size

python - Django - Edit data in db

python - InlineFormSet with queryset of different model

python - REST / JSON / XML-RPC / SOAP

Python socket error occured

Changing palette's of 8-bit .png images using python PIL

python - Nice exception handling when re-trying code

python - Classes nested in functions and attribute lookup

benchmarking - What is the recommended Python module for fast Fourier transforms (FFT)?

Python http proxy library based on libevent or comparable technology?

pygame - Python japanese module is not found

python - Really long query

is it possible to get python purple running either in cygwin or on a linux that isn't debian?

python - Store data series in file or database if I want to do row level math operations?

python String Formatting Operations

linux - Python subprocess.Popen erroring with OSError: [Errno 12] Cannot allocate memory after period of time

python - How to implement a scripting language into a C application?

python - Specifying relative path in py2exe

python - How to find Title case phrases from a passage or bunch of paragraphs

python - Regex Matching Error

python - Difference between accessing an instance attribute and a class attribute

Make python __doc__ property display correctly in a Windows CMD window?

Check for a module in Python without using exceptions

How do I remove packages installed with Python's easy_install?

python - django - QuerySet recursive order by method

Controlling getter and setter for a python's class

arrays - Merge sorted lists in python

python - How to get a reference to the module something is implemented in from within that implementation?

What's the state-of-the-art in Python programming in Windows?

how to install new packages with python 3.1.1?

python - Web programming tutorial

unit testing - Python Packages?

python - Importing Model / Lib Class and calling from controller

Python Multiprocessing Exit Elegantly How?

testing - python - Importing a file that is a symbolic link

Newbie to python conventions, is my code on the right track?

ide - New to Python. Need info on the environment for it

python - How to filter a dictionary by value?

python - Possible to share in-memory data between 2 separate processes?

pointers - How does python decide whether a parameter is a reference or a value?

database - How can I merge fields in a CSV string using Python?

How should I close a multi-line variable/comment in Python?

sign - How can I force subtraction to be signed in Python?

utility - Implement touch using Python?

python - How to stop WSGI from hanging apache

python - Django ModelForm CheckBox Widget

python - Django newbie deployment question - ImportError: Could not import settings 'settings'

python - GTK: create a colored regular button

python - subprocess: deleting child processes in Windows

python - Making sure that psycopg2 database connection alive

python - How do you force refresh of a wx.Panel?

python - GTK: Modify bg color of a CheckButton

linux - get group id by group name (Python, Unix)

python - How do I associate input to a Form with a Model in Django?

python - comparing two strings with 'is' -- not performing as expected

Accessing elements with offsets in Python's for .. in loops

python - Django empty field fallback

html - Lightweight markup language for Python

python - Displaying X and y axis in pylab

macos - How to get the desktop resolution in Mac via Python?

python - Is it possible to reference the output of an IronPython project from within a c# project?

Python script knows how much memory it's using

python - Creating DateTime from user inputted date

unit testing - python unittest assertRaises throws exception when assertRaises fails

python - Alternative to cvs2svn for performing cvs to svn migration

python - Pythonic way of checking if a condition holds for any element of a list

py2exe - Do I only need to check the users machine for the version of the MSVCR90.dll that was installed with my python installation?

django - Python TypeError unsupported operand type(s) for %: 'file' and 'unicode'

python - Standard Solution for Decoding Additive Numbers

python - DOCTEST==argv[0] as a convention?

naming conventions - is it ever useful to define a class method with a reference to self not called 'self' in Python?

python - Qt GraphicsScene constantly redrawing

metaprogramming - Pythonic Comparison Functions

python - Does Django have a built in way of getting the last app url the current user visited?

python - In Django, how to control which DB connection and cursor a queryset will use

Why can't I set a global variable in Python?

python - Error starting Django with Pinax

geometry - Python standard module for emulating geometric points

How to Compile Mod_Python 3.3.1 for Python 2.6 and Apache 2.2 on Windows?

python - How to prevent Satchmo forms from displaying asterisk after required fields?

python - Qt HTTP authentication with QNetworkAccessManager

How to write native newline character to a file descriptor in Python?

Problem with recursive search of xml document using python

python - Event Handling in Chaco

Slow regex in Python?

Does using properties on an old-style python class cause problems

python - Django Double Escaping Quotes etc

What's the Ruby equivalent of Python's os.walk?

xml - Python SOAP document handling

instantiation - In Python, what's the correct way to instantiate a class from a variable?

python function for retrieving key and encryption

python - Are there any cleverly efficient algorithms to perform a calculation over the space of partitionings of a string?

python - Django Formset without instance

php - Decode complex JSON in Python

Scraping Ajax - Using python

python - comparing and sorting array

python - Django cache.set() causing duplicate key error

write special characters into excel table by python package pyExcelerator/xlwt

What is the % operator in python for?

introspection - How can I list the methods in a Python 2.5 module?

python - Limit choices to

python - Pygame and blitting: white on white = gray?

multithreading - GIL in Python 3.1

python - How to make two elements in gtk have the same size?

python - Does __str__() call decode() method behind scenes?

Can you really use the Visual Studio 2008 IDE to code in Python?

ping - python non-privileged ICMP

In python is there an easier way to write 6 nested for loops?

php - How to co host django app with php5 on apache2 with mod_python?

python - nose tests of Pylons app with models in init_model?

Creating a board game simulator (Python?) (Pygame?)

python - Does YouTube's API allow uploading and setting of thumbnails?

How do I calculate the numeric value of a string with unicode components in python?

Asynchronous method call in Python?

keyboard - detecting two simultaneous keys in pyglet (python)

import - Problem with python and __import__

python - How to set the encoding for the tables' char columns in django?

How to update an older C extension for Python 2.x to Python 3.x

networking - How do I resolve an SRV record in Python?

What's the best way to do literate programming in Python on Windows?

python - wxPython: Items in BoxSizer don't expand horizontally, only vertically

winapi - Tkinter locks Python when an icon is loaded and tk.mainloop is in a thread

Is there a Python module to access Advantage Database Server?

Python: remove lots of items from a list

Ruby to python one-liner conversion

unicode - How to make the python interpreter correctly handle non-ASCII characters in string operations?

Unicode to UTF8 for CSV Files - Python via xlrd

Python: How to get rid of circular dependency involving decorator?

python - Can all language constructs be first-class in languages with offside-rules?

Python non-trivial C++ Extension

What are the Python thread + Unix signals semantics?

variables - python: dictionaries of lists are somehow coupled

python - How to classify users into different countries, based on the Location field

python - exec() bytecode with arbitrary locals?

python - Reason for unintuitive UnboundLocalError behaviour

python - Does 'a+' mode allow random access to files, on all systems?

python - Why is wxGridSizer much slower to initialize on a wxDialog then on a wxFrame?

sqlite - Fast, searchable dict storage for Python

python - remove duplicates from nested dictionaries in list

php - Why the trailing slash in the web service is so important?

windows xp - surprising time shift for python call

python - Changing height of an object in wxPython

python - Why saving of MSWord document can silently fail?

Convert html entities to ascii in Python

python - OCR Playing Cards

python - How to a query a set of objects and return a set of object specific attribute in SQLachemy/Elixir?

python - How can I check if a string represents an int, without using try/except?

python - Actions triggered by field change in Django

unit testing - Should Python unittests be in a separate module?

python - Combining two QMainWindows

python - How can I get nose to find class attributes defined on a base test class?

python - SQLAlchemy - Trying Eager loading.. Attribute Error

Forced to use inconsistent file import paths in Python (/Django)

Is it necessary or useful to inherit from Python's object in Python 3.x?

python - Django: Easily add extra manager for child class, still use default manager from AbstractBase

python - CopyBlock tag for Django

audio - System standard sound in Python

python - Django - SQL Query - Timestamp

python - Seeding random in django

python - back-to-back histograms in matplotlib

exception - Python Multiprocessing exit error

python - Matching blank lines with regular expressions

python - Make SetupTools/easy_install aware of installed Debian Packages?

python - Default route doesn't work

xmpp with python: xmpp.protocol.InvalidFrom: (u'invalid-from', '')

python - Regexp to literally interpret \t as \t and not tab

Import Dynamically Created Python Files

http - Python POST ordered params

python - Multiple Datacenters

How can I take a screenshot/image of a website using Python?

python - Having Django serve downloadable files

Good or bad practice in Python: import in the middle of a file

python - sqlalchemy - grouping items and iterating over the sub-lists

python - How to add bi-directional manytomanyfields in django admin?

Error with time.strptime() and python-twitter

python - Algorithm for BFS traveral of an acylic directed graph

python - What are the benefits of not using cPickle to create a persistent storage for data?

python - Passing a Django model attribute name to a function

How do I use extended characters in Python's curses library?

python - Class factory to produce simple struct-like classes?

python - Search in lists of lists by given index

web services - Why Python omits attribute in the SOAP message?

How to import python module in a shared folder?

stringio - BytesIO with python v2.5

Writing in file's actual position in Python

django - Python: Memory leak debugging

python - Signal Handler exits, but program continue to run?

regex - Composable Regexp in Python

python - Sources of PyS60's standard functions (particularly appuifw.query)

python - Controlling Django ModelForm output

python - How to specify which eth interface Django test server should listen on?

python - How to make this method non-recursive?

python - Print current call stack from a method in code

python - What's the regex for removing dots in acronyms but not in domain names?

python - how can I used the “pefile.py” to get file(.exe) version

python - Bizzare eclipse-pydev console behavior

Latin-1 and the unicode factory in Python

python - How to manage many to one relationship in Django

python - What wrong when SimpleXMLRPC and DBusGMainLoop working in the same time

python - Reusing a Django app within a single project

Python: Importing pydoc and then using it natively?

python - using the "pefile.py" to get file(.exe) version

python - Load non-uniform data from a txt file into a msql database

How to run Python egg files directly without installing them?

How to exit from Python without traceback?

python - How do unit tests work in django-tagging, because I want mine to run like that?

Getting rows from XML using XPath and Python

Python scoping problem

accessing base class primitive type in python

python - How do I detect missing fields in a CSV file in a Pythonic way?

python - Plone navigation with one-language-per-folder site

Empty XML element handling in Python

python - django @login_required decorator error

attributeerror - Attribute Error in Python

postgresql - To set up environmental variables for a Python web application

Need to add an element at the start of an iterator in python

python - When I catch an exception, how do I get the type, file, and line number?

python - Installing Django with mod_wsgi

php - Is it crazy to not rely on a caching system like memcached nowadays ( for dynamic sites )?

irc - How to make the program run again after unexpected exit in Python?

python - Django, how to make a view atomic?

python - How do I change the directory of InMemoryUploadedFile?

HTTP POST binary files using Python: concise non-pycurl examples?

python - How to eliminate last digit from each of the top lines

python - Accessing dictionary with class attribute

user interface - Python accessing multiple webpages at once

python - How to update manytomany field in Django?

python - Django saving objects - works, but values of objects seem to be cached until I restart server

cairo - How to resize svg image file using librsvg Python binding

api - Updating profile with python-twitter

python - How do I access an inherited class's inner class and modify it?

python - How to catch errors elegantly and keep methods clean?

string - Good way of handling NoneType objects when printing in Python

python - Forward declaration - no admin page in django?

python - Prevent opening a second instance

Is there a way to output the numbers only from a python list?

python - Mechanize and BeautifulSoup for PHP?

How to check if some process is running in task manager with python

What's wrong with this bit of python code using lambda?

code generation - Are there any libraries for generating Python source?

python variable scope

python - How to install a module as an egg under IronPython?

Python memory footprint vs. heap size

Python and dictionary like object

How do I convert unicode characters to floats in Python?

java to python conversion: x509 / dsa / sha1withdsa crypto howto?

Using Cheetah Templating system with windows and python 2.6.1 (namemapper problem)

In Python, how to tell if being called by exception handling code?

python subprocess module: looping over stdout of child process

python - technology recommendation for LAN Dashboard

python - How to wait for a child that respawns itself with os.execv() on win32?

python distutils / setuptools: how to exclude a module, or honor svn:ignore flag

One-liner Python code for setting string to 0 string if empty

ipython - How do I control number formatting in the python interpreter?

python - How can I pass my locals and access the variables directly from another function?

unit testing - Python's unittest and dynamic creation of test cases

interpreter - Persistent Python Command-Line History

python - Is there a class library diagram for django?

Python: List initialization differences

Python SOAPpy Errors

python - How to run statistics Cumulative Distribution Function and Probability Density Function using SciPy?

physics - Is there a standard pythonic way to treat physical units / quantities in python?

python - Configure Django project in a subdirectory using mod_python. Admin not working

metaclass - Reverse mapping class attributes to classes in Python

redirect - What is the multiplatform alternative to subprocess.getstatusoutput (older commands.setstatusoutput() from Python?

How to open python source files using the IDLE shell?

python - Another absolute import problem

python - User-specific model in Django

Can I write Python applications using PyObjC that target NON-jailbroken iPhones?

file io - Python write to line flow

python - How do you install lxml on OS X Leopard without using MacPorts or Fink?

php - Real world guide on using and/or setting up REST web services?

python - User in Form-Class

Python logging SMTPHandler - handling offline SMTP server

new style class - Python object @property

python - SQLAlchemy and django, is it production ready?

python - jQuery getJSON callback does not work - even with valid JSON - and seems to be using "OPTION" request not "GET"

Why are all the tk examples in a Python distribution written in TCL?

c++ - PyQt: how to handle auto-resize of widgets when their content changes

python - relevent query to how to fetch public key from public key server

Is there a Python module for converting RTF to plain text?

Python - Get relative path of all files and subfolders in a directory

module - Listing builtin functions and methods (Python)

How do I pick 2 random items from a Python set?

macos - Python egg: where is it installed?

image - Take screenshots **quickly** from python

python - How do I debug a py2exe 'application failed to initialize properly' error?

regex - Can someone explain this Python re.sub() unexpected output?

python - How to find the compiled extensions modules in numpy

python - SQLAlchemy Inheritance

python - Customizing modelformset fields in Django

How to find the longest word with python?

python - Executes Fine In Jail Shell but not in Browser

soap - Sage CRM web services example in Python

Integrate Python And C++

programming languages - python "block" library

python stdout flush and tee

Mercurial scripting with python

Python: update a list of tuples... fastest method

python - Running doctests through iPython and pseudo-consoles

packaging - using setuptools with post-install and python dependencies

Python string interpolation using dictionary and strings

python - Making tabulation look different than just whitespace

closures - Python nonlocal statement / keyword

python - setting option in config file using SafeConfigParser

Python: Alternatives to pickling a module

string - What's a good way to replace international characters with their base Latin counterparts using Python?

macos - Unable to install python berkeleydb access on osx

python - How do I switch this Proxy to use Proxy-Authentication?

python - python2.5 says platform dependent libraries not found

python - Nested Set Model and SQLAlchemy -- Adding New Nodes

Python 3 and static typing

python - SQLAlchemy: Operating on results

python - Threaded Django task doesn't automatically handle transactions or db connections?

python - What is the best way to handle rotating sprites for a top-down view game

python - to restrict parameter values strictly with in bounds

calendar - Python dateutil.rrule is incredibly slow

libpurple - Are there any examples on python-purple floating around?

file - python shutil.copytree - ignore permissions

syntax - Is there a wiki processor for Trac to format and colour Python tracebacks?

linux - Read content of RAR file into memory in Python

python - Is it possible to use Panda3D inside a wxPython app?

Python: binary/hex string conversion?

python - How to use Staticgenerator with Django + Apache + mod_python

berkeley db - BDB Python Interface Error when Reading BDB

Hierarchical Bayes for R or Python

Vim python's buffer.append(line) switch window's focus

Can I use C++ features while extending Python?

image - FFT for Spectrograms in Python

python - How can I execute CGI files from PHP?

python - How to implement a state-space tree?

python - Grant anonymous access to a specific url/action in Plone

python - Does django's Form class maintain state?

python - What's the fastest way to fixup line-endings for SMTP sending?

c++ - Hello World from cython wiki not working

python - Choose the filename of an uploaded file with Django

Parallel SSH in Python

Lua vs PHP/Python/JSP/etc

winapi - Creating a single exe file from Python code

python - imagefield won't validate

Eliminate part of a file in python

python - Application Structure for GUI & Functions

job queue implementation for python

debugging - How do I set sys.excepthook to invoke pdb globally in python?

macos - How to associate py extension with python launcher on Mac OS X?

decorator - Python decorate a class to change parent object type

python - collapsing whitespace in a string

python - Pyqt GroupBox parenting

How to find out if a Python object is a string?

python - How to use the same widget twice in pygtk?

python - Sorting and indexing into a list in a Django template?

python - How to extend distutils with a simple post install script?

python - Twisted(asynch server) vs Django(or any other framework)

python - Looking for a diagram to explain WSGI

python - function decorators in c#

Performance - Python vs. C#/C++/C reading char-by-char

python - Returning None or a tuple and unpacking

python - Read from socket: Is it guaranteed to at least get x bytes?

python - FormEncode, pylons, and mako example

windows - How to start a COM server implemented in python?

Python: ZODB file size growing - not updating?

python - Custom QStyledItemDelegate: adding bold items

python - math.sin incorrect result

Graph databases and RDF triplestores: storage of graph data in python

python - Loading and saving data from m2m relationships in Textarea widgets with ModelForm

python - Bind event to wx.Menu() instead of to the menu item in wxPython

python - Help with MySQL LOAD DATA INFILE

Python: how do I implement 'pop' in this class?

Detect and delete locked file in python

networking - Interface with remote computers using Python

python - Difference between returning modified class and using type()

Reading XML using Python minidom and iterating over each node

Is it a good idea to hash a Python class?

python - Hosting Mercurial with IIS 6

Need help in refactoring my python script

Python FTP Most Recent File

Count number of files with certain extension in Python

python - Grouping dates in Django

database - Agile Software Development in Python

Writing Windows GUI applications with embedded Python scripts

Shortest hash in python to name cache files

Python: what's the pythonic way to perform this loop?

python - What's the best way to optimize this MySQL query?

python - Removing redundant symbols from string

python - Checking whether a command produced output

python - How to populate a list with items.count() from a queryset sorted by a datetime field

python - Any reason why socket.send() hangs?

Is 'for x in array' always result in sorted x? [Python/NumPy]

python - Good graph traversal algorithm

Python thread dump

How do you reload your Python source into the console window in Eclipse/Pydev?

https - python urllib, how to watch messages?

Python urllib.urlopen() call doesn't work with a URL that a browser accepts

python - How to encrypt a string using the key

python - What are the different options for processing uploaded PDF files in a Django application?

python - Selecting related objects in django

python - What possible values does datetime.strptime() accept for %Z?

Python CGI returning an http status code, such as 403?

python - Comma separated lists in django templates

Automatically Generated Python Code from an UML diagram?

How can I convert a URL query string into a list of tuples using Python?

python - Iteration over list slices

python - How do I use PIL with Tkinter?

multithreading - What difference it makes when I set python thread as a Daemon

python - pywikipedia bot with https and http authentication

python - How do I use StandardAnalyzer with TermQuery?

python - urlopen, BeautifulSoup and UTF-8 Issue

Python Class vs. Module Attributes

django - Creating multiple Python modules in different directories that share a portion of the package structure

python - Convert a nested dataset to a flat dataset, while retaining enough data to convert it back to nested set

python - How to get '\x01' to 1

python - Network Support for Pygame

How to submit data of a flash form? [python]

python - What is the best open source solution for storing time series data?

python - Django FileField with upload_to determined at runtime

python - How do I see stdout when running Django tests?

python - Django - Getting last object created, simultaneous filters

OpenGL in Python with Snow Leopard?

printing - What is the simplest way (in python) to print to a remote IPP/CUPS server or printer?

Help with basic Python function

Executing current Python script in Emacs on Windows

python - create an array from a txt file

data structures - Key-ordered dict in Python

python - percentage difference between two text files

python - py2app error: "'module' object has no attribute 'symlink'"

compression - Decompressing a .bz2 file in Python

python - How do you dynamically hide form fields in Django?

python - AttributeError: 'NoneType' object has no attribute 'GetDataStore'

python - How do you enable auto-scrolling on GtkSourceView2?

python - py2app error: "can't copy '%s': doesn't exist or not a regular file"

python - Is this a good approach to avoid using SQLAlchemy/SQLObject?

Produce multiple files from a single file in python

python - Having problem with IronPython to instantiate a class in IronPython Console

debugging - Compiling python modules with DEBUG defined on MSVC

php - Aggregate photos from various services into one Stream

How to read String in java that was written using python's struct.pack method

apache flex - Can I "embed" a Python back-end in an AIR application?

python - How do I stop getting ImportError: Could not import settings 'mofin.settings' when using django with wsgi?

python - How to change baseclass

python - wxPython gauge problem (skipping)

python - Django: do I need to restart Apache when deploying?

python - Finding Functions Defined in a with: Block

regex - How to find the url using the referer and the href in Python?

python - Locking in sqlalchemy

How to build sqlite for Python 2.4?

python - Using XPath in ElementTree

python - How can I mass-assign SA ORM object attributes?

python - How to pickle numpy's Inf objects?

python - Combining two lists and removing duplicates, without removing duplicates in original list

sockets - Could not get out of python loop

word wrap - Python PEP8 printing wrapped strings without indent

python - text file format from array





top