Python Patterns & Practices

Find The Best Answers To Your Python Coding Problems



python - WeakValueDictionary for holding any type

d - Calling gdc/dmd shared libraries from Python using ctypes

Looking for a better alternative to PIL for basic image file I/O and processing in Python?

python - Tokenizing left over data with lex/yacc

c - How to port this NetHack function to Python?

user interface - About GUI editor that would be compatible with Python 3.0

math - Efficient python code for printing the product of divisors of a number

How to include external Python code to use in other files?

python - mod_python publisher and pretty URLs

python - Django serializer gives 'str' object has no attribute '_meta' error

How to initialize variables to None/Undefined and compare to other variables in Python?

python - Django 1.0, using default password reset

Can I write my apps in python and then run them from C?

unicode - Any gotchas using unicode_literals in Python 2.6?

python - How do I print outputs from calls to subprocess.Popen(...) in a loop?

python - How to edit raw PCM audio data without an audio library?

javascript - How to construct a web file browser?

How do you store raw bytes as text without losing information in python 2.x?

distributed/faster python unit tests

python - keeping same formatting for floating point values

python - How to avoid Gdk-ERROR caused by Tkinter, visual, and ipython?

python - wxPython won't close Frame with a parent who is a window handle

Does Ruby have an equivalent of Python's twisted framework as a networking abstraction layer?

python - Computing the second (mis-match) table in the Boyer-Moore String Search Algorithm

pyqt4 - Turning ctypes data into python string as quickly as possible

python - How to calculate cumulative normal distribution?

ruby - How to execute an arbitrary shell script and pass multiple variables via Python?

Any python OpenID server available?

python - Django Manager Chaining

format - String formatting in Python version earlier than 2.6

Getting name of windows computer running python script?

How do you alias a python class to have another name without using inheritance?

python - Sorting a tuple that contains lists

python - Opinions on Unladen Swallow?

python - Find all IPs on an HTML Page

python - WxPython differences between Windows and Linux

Is Python the right hammer for this nail? (build script)

javascript - Python HTML output (first attempt), several questions (code included)

python - Sort lexicographically?

php - How can I generate a screenshot of a webpage using a server-side script?

multithreading - Python - Threading and a While True Loop

python - Popen log management question

python - SQLAlchemy - Mapper configuration and declarative base

python - using "range" in a google app engine template for - loop

functional programming - Python equivalent of maplist?

django - Print long integers in python

Recommendations of Python REST (web services) framework?

Extracting a URL in Python

python - Validating a slug in Django

Catching an exception while using a Python 'with' statement

How does Python OOP compare to PHP OOP?

c# - Creating an interactive shell for .NET apps and embed scripting languages like python/iron python into it

64 bit - Is there a list of Python packages that are not 64 bit compatible somewhere?

python - Preserving the Java-type of an object when passing it from Java to Jython

javascript - Save an html page + change all links to point to the right place

Configure Apache to use Python just like CGI PHP

How to use time > year 2038 on official Windows Python 2.5

python - How to disable v1 tag in a Web service request with SoapPy?

Best Practices for Python Exceptions?

python - Is something like ConfigParser appropriate for saving state (key, value) between runs?

Is it reasonable to integrate python with c for performance?

Python exceptions: call same function for any Exception

Printing XML into HTML with python

python - Regular expression syntax for "match nothing"?

python - Decoding problems in Django and lxml

python - Set up svnperms pre-commit hook

python - Twisted and p2p applications

Python creating a dictionary of lists

python - Passing data to mod_wsgi

python - How to debug PYGTK program

python - cursor.rowcount always -1 in sqlite3 in python3k

How to output list of floats to a binary file in Python

python 3.x - python3.0: imputils

python - Using list comprehensions and exceptions?

Emacs function to message the python function I'm in

python - Sorted collections: How do i get (extended) slices right?

python - Django m2m queries, distinct Users for a m2m relationship of a Model

Python cgi and stdin

Would it be possible to write a 3D game as large as World of Warcraft in pure Python?

python - PyQt and context menu

Swig bindings for python/lua do not initialize member data properly

python - What is the proper way to compute the fully expanded width of wx.TreeCtrl

Python dictionary deepcopy

http - How do you transfer binary data with Python?

python - Penalties of a script constantly looping in the background

python - Strings and file

python - How can I handle a mouseMiddleDrag event in PythonCard?

database - python orm

Python's file.read() on Ubuntu

python - How to catch POST using WSGIREF

How does Spring for Python compare with Spring for Java

How to hide __methods__ in python?

python - Can I change BeautifulSoup's behavior regarding converting XML tags to lowercase?

python - how can I decode the REG_BINARY value HKLM\Software\Microsoft\Ole\DefaultLaunchPermission to see which users have permission?

python - how can I add a QMenu and QMenuItems to a window from Qt Designer

python - Django Admin & Model Deletion

plot - Python plotting libraries

winapi - Communicating with a Python service

python - Dynamically specifying tags while using replaceWith in Beautiful Soup

python - Python3 Http Web Server: virtual hosts

Python Extension Returned Object Etiquette

python - How do I use 'F' keys in gtk Accelerators?

parsing - How to parse a RFC 2822 date/time into a Python datetime?

python - os.path.exists() for files in your Path?

python - How to spawn parallel child processes on a multi-processor system?

python - CSS parser + XHTML generator, advice needed

python - PyQt sending parameter to slot when connecting to a signal

python - Dynamic generation of .doc files

python - How to set correct value for Django ROOT_URLCONF setting in different branches

Wrapping a Python Object

python - where can I find GladeGen?

python - How do you reload a Django model module using the interactive interpreter via "manage.py shell"?

Python 2.6 subprocess.call() appears to be invoking setgid behavior triggering Perl's taint checks. How can I resolve?

python - Django EmailMultiAlternatives and HTML e-mail display in Outlook 2003 on Win2003

python - SQLAlchemy - Dictionary of tags

python - How to return a function value with decorator and thread

Getting a list of specific index items from a list of dictionaries in python (list comprehension)

Directory Walker for Python

python - How can I create a RSA public key in PEM format from an RSA modulus?

audio - Playing and controlling mp3 files in Python?

Distributing Ruby/Python desktop apps

python - How to ensure xml.dom.minidom can parse its own output?

Install older versions of Python for testing on Mac OS X

inheritance - Python base class method call: unexpected behavior

php - chunk_split in python

How to pass pointer to an array in Python for a wrapped C++ function

What is an exotic function signature in Python?

python - Efficiently determining if a business is open or not based on store hours

Looking for the "Hello World" of ctypes unicode processing (including both Python and C code)

python - datetime.now() in Django application goes bad

python - Any graphics library for unix that can draw histograms?

How to automatically reload a python file when it is changed

python - How do I update an object's members using a dict?

python - What is the fastest way to draw an image in Gtk+?

Python/Ruby as mobile OS

pickle - Python: How do I write a list to file and then pull it back into memory (dict represented as a string convert to dict) later?

python - Custom implementation of "tail -f" functionality in C

I need a beginners guide to setting up windows for python development

python - Convert a number to a list of integers

Multiple statements in list compherensions in Python?

python - Override default in sqlalchemy reflected tables

python - What is wrong with this SimPy installation?

Explain to me what the big deal with tail call optimization is and why Python needs it

python - print vs stderr

Unescape Python Strings From HTTP

django - What's a good way to mix RSS feeds using Python?

python - How do I create collision detections for my bouncing balls?

setuptools - Explain Python entry points?

python - Optparse: Usage on variable arg callback action does not indicate that extra params are needed

Parsing numbers in Python

.net - Why would one choose Iron Python instead of Boo?

c - Installing bitarray in Python 2.6 on Windows

visualization - Scientific Plotting in Python

python - Given a date range how to calculate the number of weekends partially or wholly within that range?

Is it possible to overload ++ operators in Python?

Purpose of @ symbols in Python?

python - Algorithm to Divide a list of numbers into 2 equal sum lists

Python, SimPy: How to generate a value from a triangular probability distribution?

python - How do I get the last number from the range() function?

python - Custom ordering in Django

Python scripted mp3 database, with a php front end

python - Printed representation of list

python - How do I detect when my window is minimized with wxPython?

python - What to write into log file?

not able to start coding in python

python - Regex for finding date in Apache access log

python - Elegant, pythonic solution for forcing all keys and values to lower case in nested dictionaries of Unicode strings?

Python function calls are bleeding scope, stateful, failing to initialize parameters?

python - logging in mod_python/apache

process - Python Multiprocessing atexit Error "Error in atexit._run_exitfuncs"

python - callable as instancemethod?

debugging - Stop python from closing on error

diff - Python difflib: highlighting differences inline?

python - Business rules for calculating prices

python - How do I iterate over the HTML attributes of a Beautiful Soup element?

Using Gecko/Firefox or Webkit got HTML parsing in python

python - How do you remove html tags using Universal Feed Parser?

unit testing - Python unittest: how do I test the argument in an Exceptions?

python - How do I generate circular thumbnails with PIL?

python - WxPython: FoldPanelBar not really folding

I need a regex for the href attribute for an mp3 file url in python

python - wxPython + multiprocessing: Checking if a color string is legitimate

python - Find all possible factors in KenKen puzzle 'multiply' domain

php - SFTP listing directory

Python Multiprocessing: Sending data to a process

python - Is it possible to format a date with sqlite3?

svn - How to use subversion Ctypes Python Bindings?

Emacs Pabbrev and Python

Python +sockets

Python disable/redirect keyboard input

testing - Accurate timing of functions in python

packaging - How to upload a pristine Python package to PyPI?

Is storm Python 3 compatible?

python - django excel xlwt

php - C# Web Server: Implementing a Dynamic Language

python - How to separate content from a file that is a container for binary and other forms of content

http - How can I read()/write() against a python HTTPConnection?

Python imports from crossreferencing packages

Calling python from python - persistence of module imports?

Python sockets buffering

python - regex for parsing SQL statements

python - How can I determine if one PGArray is included in another using SQLAlchemy sessions?

python - Is there a way to poll a file handle returned from subprocess.Popen?

debugging - Is mod_wsgi/Python optimizing things out?

Updating tkinter labels in python

python - How to center a GNOME pop-up notification?

python - Dividing in an if statement

what python feature is illustrated in this code?

hash - Detecting Retweets using computationally inexpensive Python hashing algorithms

It there an equivalent to PHP's extract in Python?

python - Identifying the types of all variables in a C project

How to designate unreachable python code

tsql - SQL TOP 1 analog for lists in Python

python - How to hide "cgi-bin", ".py", etc from my URLs?

python - Accepting email address as username in Django

decorator - How to access the parent class during initialisation in python?

python - Why are 0d arrays in Numpy not considered scalar?

python - Where can I find some "hello world"-simple Beautiful Soup examples?

Where to keep Python unit tests?

regex - Python regular expression to match # followed by 0-7 followed by ##

smtp - smtplib and gmail - python script problems

python - Rendering JSON objects using a Django template after an Ajax call

python - SyntaxError in finally (Django)

python - Function Decorators

retrieving current drive letters in windows (from python)

python - Free word list for use programmatically?

regex - python regular exp. with a unicode char

Substituting a regex only when it doesn't match another regex (Python)

python - problem opening a text document - unicode error

python - How to bestow string-ness on my class?

zip - How to create a password protected zipfile with python?

python - isDigit() for rational numbers?

python - mounting an s3 bucket in ec2 and using transparently as a mnt point

python - How to use dynamic foreignkey in Django?

python - pyExcelerator or xlrd - How to FIND/SEARCH a row for the given few column data?

daemon - Daemonizing python's BaseHTTPServer

python - Why is Maya 2009 TreeView control giving a syntax error on drag?

Oracle / Python Converting to string -> HEX (for RAW column) -> varchar2

Unbuffered stdout in python (as in python -u) from within the program

python - Django payment processing

python - If slicing does not create a copy of a list nor does list() how can I get a real copy of my list?

python - How to query any constraint's target list without knowing the constraint type?

exception - python, __slots__, and "attribute is read-only"

Python regex parsing

python - ManyToOneField in Django

django - Iterating through large lists with potential conditions in Python

python - How to tell if a class is descended from another class

macos - Python Opencv Ubuntu not creating Windows

Running python code from standard Cocoa application

html - Python lxml screen scraping?

Make Emacs use UTF-8 with Python Interactive Mode

pipe - Python subprocess "object has no attribute 'fileno'" error

Easiest way to rm -rf in Python

Python open raw audio data file

shell - How to save a Python interactive session?

Other than basic python syntax, what other key areas should I learn to get a website live?

python - Am I missing step in building/installing VTK-5.4 with Python2.6 bindings on Ubuntu 9.04?

debian - Python imports: importing a module without .py extension?

python - PY2EXE: How to output "*_D.PYD" file (debug) and use MSVCR80D.DLL?

How can I make a change to a module without restarting python interpreter?

python - How to add a second bouncing ball to the window?

compiler construction - Why python compile the source to bytecode before interpreting?

python - How can I get an accurate absolute url from get_absolute_url with an included urls.py in Django?

macos - How to Fix the Broken BSDDB Install in the Default Python Package on Mac OS X 10.5 Leopard?

python - Render PyCairo onto PyOpenGL surface?

In print statements, what determines whether python shell prints null character or waits for input

django - How do I set up a model to use an AutoField with a legacy database in Python?

python: attributes on a generator object

python - How do I handle exceptions when using threading and Queue?

python - Change file creation date

encoding - Best way for Parsing ANSI and UTF-16LE files using Python 2/3?

python - pyqt4 and pyserial

Strip all non-numeric characters (except for ".") from a string in Python

byte - Efficient arbitrary-sized integer packing in Python

python - Auto-tab between fields on Django admin site

python - If I want to use a pylons app with Apache, should I use mod_wsgi or proxy to paste?

python - Is there support for the IN-operator in the "SQL Expression Language" used in SQLAlchemy?

python - Django Form values without HTML escape

python - How to I reload global vars on every page refresh in DJango

Python: how to store a draft email with BCC recipients to Exchange Server via IMAP?

python - SQLAlchemy - Database hits on every request?

networking - How can I check if an ip is in a network in Python?

functional programming - Is there a way to check whether function output is assigned to a variable in Python?

Custom simple Python HTTP server not serving css files

python - Working with a QString encoding

Error occurs when I connect with socket in Python

cgi - Python, who is calling my python module

multithreading - Synchronising multiple threads in python

python - using pyodbc on linux to insert unicode or utf-8 chars in a nvarchar mssql field

python - What does the 'shell' argument in subprocess mean on Windows?

Python reflection - Can I use this to get the source code of a method definition

Embedding a Python shell inside a Python program

matlab - Machine vision in Python

Is there a way to correctly sort unicode strings in SQLite using Python?

macos - Get file creation time with Python on Mac

how to send email in python

flex3 - Call python script from AIR application?

xml - fastest way to store comment data python

python - How to convert strings numbers to integers in a list?

io - How to suppress the carriage return in python 2?

python - Using Twisted's twisted.web classes, how do I flush my outgoing buffers?

python - WxPython: Cross-Platform Way to Conform Ok/Cancel Button Order

python - Ruby String Translation

ssh - How to execute a process remotely using python

Safe Python Environment in Linux

python - Monitoring a tcp port

Does Python have properties?

python - Simple webserver or web testing framework

python - Parse a .txt file

Using Python's list index() method on a list of tuples or objects?

python - Controlling bars width in matplotlib with per-month data

Is it possible to implement a Python for range loop without an iterator variable?

python - Qt-style documentation using Doxygen?

Equivalent JavaScript functions for Python's urllib.parse.quote() and urllib.parse.unquote()

Python + PHP + Lighttpd?

python - I want to make a temporary answerphone which records MP3s

php - Web-Based Music Library (programming concept)

python - "OSERROR -10000 Apple event handler failed" when trying to change desktop wallpaper on Mac

Making a python cgi script to finish gracefully

is there a multiple format specifier in Python?

GStrings in Python

python - How to debug wxpython applications?

python - Error when trying to migrate django application with south

python - Why doesn't anyone care about this MySQLdb bug? is it a bug?

sockets - Multiple simultaneous network connections - Telnet server, Python

regex - Spliting a file into lines in Python using re.split

delegates - Thread Finished Event in Python

Get the 1-norm of a vector in Python

python - How to get the public channel URL from YouTubeVideoFeed object using the YouTube API?

(Python) socket.gaierror: [Errno 11001] getaddrinfo failed

python - Pythonic URL Parsing

c - Python's bz2 module not compiled by default

regex - Python: Replace string with prefixStringSuffix keeping original case, but ignoring case when searching for match

python - What is "generator object" in django?

iterator - How to use counter in for loop python

file io - Python $OUTPUT_RECORD_SEPARATOR and $INPUT_RECORD_SEPARATOR equivalent

windows - Launch a webpage on a Firefox (win) tab using Python

python - How to perform a query in django that selects all projects where I am a team member of?

How to redirect the output of .exe to a file in python?

access eggs in python?

windows - How to set up Python in a web server?

Applications of Python

oop - Shouldn't __metaclass__ force the use of a metaclass in Python?

Resources (resx) with Python

python - Installing Django on Shared Server: No module named MySQLdb?

python - Django without shell access

python - Should I implement the mixed use of BeautifulSoup and REGEXs or rely solely on BS

python - How can I begin with Tkinter?

What tools do web developers use with PHP, Ruby on Rails, Python, etc?

python - Filetype information

python - Beautiful Soup and uTidy

import - Python: Finding all packages inside a package

python - How many times was logging.error() called?

python - What does python3 do with the methods passed to the "key" argument of sorted()?

python - MPI4Py Scatter sendbuf Argument Type?

Python bindings for libparted?

c++ - cxxTestgen.py throw a syntax error

What is "wua" mode when opening a file in python?

python - Scaffold or django-admin without Auth app

python - C55: More Info?

python - drawing a pixbuf onto a drawing area using pygtk and glade

Python - Overridding print()

Why does python logging package not support printing variable length args?

python - How can I get my setup.py to use a relative path to my files?

python - Can modules have properties the same way that objects can?

Python imaging, resize Turtle Graphics window

python - What is the best secure way to allow a user to delete a model instance that they added to the db?

standards - What version of Python (2.4, 2.5, 2.6, 3.0) do you standardize on for production development efforts (and why)?

python - Creating dictionaries with pre-defined keys

python - Can I use re.sub (or regexobject.sub) to replace text in a subgroup?

java - How do you create an anonymous Python telnet connection?

python - Parsing HTTP User-Agent string

python - How to strip html/javascript from text input in django

php - How does MySQL's RENAME TABLE statment work/perform?

using Python objects in C#

Unique session id in python

python - A production ready server to serve django on win32

python - Canonical/Idiomatic "do what I mean" when passed a string that could a filename, URL, or the actual data to work on

python - How do you know when looking at the list of attributes and methods listed in a dir which are attributes and which are methods?

how to parse windows inf files for python?

python - What causes this Genshi's Template Syntax Error?

Python's random: What happens if I don't use seed(someValue)?

How do I structure Python code into modules/packages?

dns - dnspython and python objects

How to make a persistent com server in Python

python - logging with filters

multithreading - Python Timeout script to kill thread active for more than X seconds

python - FIFO (named pipe) messaging obstacles

Update Facebooks Status using Python

python - How to print the comparison of two multiline strings in unified diff format?

database - What is the least resource intense data structure to distribute with a Python Application

Looking for a pure Python library for the SyncML protocol

Converting a java System.currentTimeMillis() to date in python

python - Overriding the save method in Django ModelForm

python - Nokia N95 and PyS60 with the sensor and xprofile modules

Python Cmd module, subclassing issue

windows - How can I create a locked-down python environment?

django - Python learning environment

python - How do you calculate the greatest number of repetitions in a list?

python - Using mx:RemoteObject with web2py's @service.amfrpc decorator

python - Global HotKeys in Win&X11

Delete digits in Python (Regex)

python - Using Beautiful Soup, how do I iterate over all embedded text?

Concise vector adding in Python?

Serializing a Python Object to XML (Apple .plist)

asp.net - Python selecting a value in a combo box and HTTP POST

database - Sqlite and Python -- return a dictionary using fetchone()?

python - Closing and Opening Frames in wxPython

decorator - Python convert args to kwargs

python - How do I use AND in a Django filter?

Emulating pass-by-value behaviour in python

python - How to scroll automatically within a Tkinter message window

python - Checking to See if a List Exists Within Another Lists?

Call a function with argument list in python

How to ignore deprecation warnings in Python

python - wxPython dialogs: "Enter" keyboard button would not "ok" the dialog

python - Problem when using MemoryDC

python - reading a stream made by urllib2 never recovers when connection got interrupted

Python Iterator Help + lxml

python - Multiple projects from one setup.py?

python - Is it possible to write a great PHP app which uses Unicode?

python - wxPython: A foldable panel widget

python - The lines that stand out in a file, but aren't exact duplicates

python - Problems eagerloading a set of object using SQLAlchemy

python - how to manually assign imagefield in Django

beautifulsoup - Dynamically change range in Python?

operator overloading - How can I make a class in python support __getitem__, but not allow iteration?

VIM: Use python 2.5 with vim 7.2

unicode - string encodings in python

Python's PIL crop problem: color of cropped image screwed

Extracting YouTube Video's author using Python and YouTubeAPI

python - How to create a message box with tkinter?

syntax - Unable to understand a line of Python code exactly

syntax - What's the difference between "2*2" and "2**2" in Python?

Total memory used by Python process?

python - Form Validation in Admin with Inline formset and Model form

python - Configure Apache to recover from mod_python errors

python - Django form field using SelectDateWidget

Unable to solve a Python error message

python - save an image with selenium & firefox

python - "x Days ago' template filter in Django?

python - Scope of lambda functions and their parameters?

Mosso Python Module

Convert python filenames to unicode

macos - python- is beautifulsoup misreporting my html?

python - Is Pylons enterprise-ready?

python - Defining dynamic functions to a string

Python error: IndexError: list assignment index out of range

python - str.format() -> how to left-justify

What is the proper procedure for offering a patch to the Python documentation?

Biggest python projects

python - Django: custom constructor for form class, trouble with accessing data from request.POST

python - Are inner-classes unpythonic?

python - django Authentication using auth.views

python - Optimal tab size for code readability

python - Performing a getattr() style lookup in a django template

BeanStalkd on Solaris doesnt return anything when called from the python library

refactoring - Python: avoiding Pylint warnings about too many arguments

Fedora Python Upgrade broke easy_install

Python regex for finding contents of MediaWiki markup links

python - Bad Practice to run code in constructor thats likely to fail?

python - Some help understanding async USB operations with libusb-1.0 and ctypes

python - Unicode Problem with SQLAlchemy

ctypes - How to do cleanup reliably in python?

import - Using Python multiprocessing while importing a module via file path

Reading a single character (getch style) in Python is not working in Unix

security - What is the most secure python "password" encryption

Where is Python's "best ASCII for this Unicode" database?

multithreading - Mutex in Python Twisted

Preprocessing route parameters in Python Routes

python - How to work with threads in pygtk

python - Is Python2.6 stable enough for production use?

Python regex question: stripping multi-line comments but maintaining a line break

parsing in python

What's the official way of storing settings for Python programs?

python - Making a wxPython application multilingual

Debugging swig extensions for Python

python - Install CherryPy on Linux hosting provider without command line access

Is a graph library (eg NetworkX) the right solution for my Python problem?

python - Downloading a Large Number of Files from S3

eclipse - Jump into a Python Interactive Session mid-program?

html - How to unescape apostrophes and such in Python?

Check if Python Package is installed

Using the AND and NOT Operator in Python

python - Best Practise for transferring a MySQL table to another server?

Python - simple reading lines from a pipe

python - How to measure Django cache performance?

Is there a uniform python library to transfer files using different protocols

python - How to match a string of a certain length with a regex

python - Regular expression implementation details

Parsing an unknown data structure in python

python - List a dictionary

python - <option> Level control of Select inputs using Django Forms API

python - Need help for facebook fql query

string - Simplifying Data with a for loop (Python)

python - Encrypt a string using a public key

python - Share objects with file handle attribute between processes

python - Django unit testing with date/time-based objects

python - where to put method that works on a model

Python: Reading part of a text file





top