Python Patterns & Practices

Find The Best Answers To Your Python Coding Problems



Python coding standards/best practices

python - How do I take the output of one program and use it as the input of another?

Executing command line programs from within python

Using wget in python (Error Code Help me)

Delete Chars in Python

Python FastCGI under IIS - stdout writing problems

Hide Folders/ File with Python

machine learning - Sentiment analysis for Twitter in Python

python - How to check if a file can be created inside given directory on MS XP/Vista?

python - Tools for creating text as bitmaps (anti-aliased text, custom spacing, transparent background)

What do I use on linux to make a python program executable

How can I split a url string up into separate parts in Python?

python - SQLAlchemy and empty columns

python - Save a deque in a text file

python - jcc.initVM() doesn't return when mod_wsgi is configured as daemon mode

vb6 - Is there a tool for converting VB to a scripting language, e.g. Python or Ruby?

A get() like method for checking for Python attributes

embedded - Which new mp3 player to run old Python scripts

Adobe Flash and Python

Writing unit tests in Django / Python

java - mssql handles line returns rather awkwardly

serialization - Python serialize lexical closures?

The best way to invoke methods in Python class declarations?

python - Parsing Functions

Creating an inheritable Python type with PyCxx

Good Python networking libraries for building a TCP server?

coding style - Alternatives for returning multiple values from a Python function

python - Getting TRAC to run on IIS7

reflection - How to dynamically load a Python class

python - Any way to create a NumPy matrix with C API?

regex - Python using result of function for Regular Expression Substitution

python - How can I get the number of records that reference a particular foreign key in Django?

regex - Python regular expressions - how to capture multiple groups from a wildcard expression?

python - What's the best way to find the inverse of datetime.isocalendar()?

c++ - Python C-API Object Allocation

python - Find all nodes from an XML using cElementTree

python - dead simple Django file uploading not working :-((

Drawing a chart with proportional X axis in Python

python - Adding a SOAP header to a SOAPpy request

python - unit testing for an application server

python - Twisted FTPFileListProtocol and file names with spaces

How to configure vim to not put comments at the beginning of lines while editing python files

Send Info from Script to Module Python

python - Qt being now released under LGPL, would you recommend it over wxWidgets?

python - Solr search with escaping solr reserved keywords

python - Multiple-instance Django forum software

python - Emacs 23 and iPython

python - How do I create a Django form that displays a checkbox label to the right of the checkbox?

python - Beginner: Trying to understand how apps interact in Django

How can I split a file in python?

oop - Do OO design principles apply to Python?

(Python) socket.gaierror on every addres...except http://www.reddit.com?

python - Cleaner way to query on a dynamic number of columns in Django?

Python - Hits per minute implementation?

python - Django and Sqlite Concurrency issue

Newbie Python Question about tuples

append - Adding elements to python generators

python - How to blend drawn circles with pygame

python - Generating lists/reports with in-line summaries in Django

c# - Is there a better StringCollection editor for use in PropertyGrids?

python - How do I remove/delete a folder that is not empty?

How to work with very long strings in Python?

python - The `%` operator

python - django application configuration

Resources for TDD aimed at Python Web Development

python - Best Django 'CMS' component for integration into existing site

How Do I Perform Introspection on an Object in Python 2.x?

linux - Making Python default to another version installed on a shared host

function - What's the reason of providing some of the default methods in the global scope in Python?

Parallel processing from a command queue on Linux (bash, python, ruby... whatever)

windows xp - Cygwin and Python 2.6

windows - Using DPAPI with Python?

python - Programmatic Form Submit

variables - Are there any declaration keywords in Python?

python - How to add file extensions based on file type on Linux/Unix?

python - Django missing translation of some strings. Any idea why?

metaprogramming - Is anyone using meta-meta-classes / meta-meta-meta-classes in Python/ other languages?

triangle numbers in python

django - How do I run another script in Python without waiting for it to finish?

python - Django + FastCGI - randomly raising OperationalError

Python - Doing absolute imports from a subfolder

Split tags in python

continuous integration - Tool (or combination of tools) for reproducible environments in Python

python - Resolving a relative url path to its absolute path

python - What values to use for FastCGI maxrequests, maxspare, minspare, maxchildren?

string - Extending builtin classes in python

authentication - In Python, how might one log in, answer a web form via HTTP POST (not url-encoded), and fetch a returned XML file?

typing - How can I type-check variables in Python?

python - Capitalize a string

regex - Python Regular Expression to add links to urls

Using base class constructor as factory in Python?

python - Django "SuspiciousOperation" Error While Deleting Uploaded File

python - Length of generator output

python - How to program a schedule

python - Django "Did you mean?" query

Return file from python module

python - How to process two forms in one view?

encoding - UnicodeEncodeError with BeautifulSoup 3.1.0.1 and Python 2.5.2

Python c-api and unicode strings

python - Is there a way to install the scipy special module without the rest of scipy?

php - Why avoid CGI for Python with LAMP hosting?

python - Deploying Google Analytics With Django

python - How to make a color from a number

python - Most pythonic form for mapping a series of statements?

python - Trimming Mako output

Detect when a Python module unloads

Schwartzian sort example in "Text Processing in Python"

Python imaplib Gmail authenticate failure

python - How to query as GROUP BY in django?

c# - Good language to develop a game server in?

python - Detect duplicate MP3 files with different bitrates and/or different ID3 tags?

python - Where can i get a wiki formatting widget for my django application?

python - Is it possible to make text translucent in wxPython?

functional programming - Modify bound variables of a closure in Python

How do I send a HTTP POST value to a (PHP) page using Python?

python - How do I add plain text info to forms in a formset in Django?

python - How can I get the newest file from an FTP server?

python - Can I get the matrix determinant using Numpy?

python - The OLE way of doing drag&drop in wxPython

Is there a Ruby/Python HTML reflow/layout library?

python - A QuerySet by aggregate field value

syntax rules - What does the “|” sign mean in Python?

Packet sniffing in Python (Windows)

python IPC (Inter Process Communication) for Vista UAC (User Access Control)

Python with Netbeans 6.5

python - What are some (concrete) use-cases for metaclasses?

python - What does "|" sign mean in a Django template?

python - IronPython on ASP.NET MVC

oop - Python - why use "self" in a class?

XML-RPC and Continuum from Python / Perl

Java "Virtual Machine" vs. Python "Interpreter" parlance?

python - wxPython and sharing objects between windows

Cross Platform SWF Playback with Python?

python - group by in django

Simulating a 'local static' variable in python

python - Pythoncard item setsize

Java Servlet Filter Equivalent in Ruby [on Rails] and PHP?

Python Optparse list

python - PostgreSQL procedural languages: to choose?

Organising my Python project

Driving Excel from Python in Windows

python - Filtering away nearby points from a list

python - SCons: How can I create a link to another repository's target if the target is built in the other repository

security - Python Applications: Can You Secure Your Code Somehow?

python - Algorithm to generate spanning set

python - URLs: Binary Blob, Unicode or Encoded Unicode String?

python - pyGTK Radio Button

python - Non-ascii string in verbose_name argument when declaring DB field in Django

python - Why am I seeing 'connection reset by peer' error?

python - How do I get the current time?

user interface - Are there any good 3rd party GUI products for Python?

python - Why does gethostbyaddr(gethostname()) return my IPv6 IP?

python - Calling Application Methods from a wx Frame Class

python - Py2Exe - "The application configuration is incorrect."

Best way to create a simple python web service

iterator - Is there any built-in way to get the length of an iterable in python?

python - How to subtract a day from a date?

wamp - Setting up Python on Windows/ Apache?

python - How do you debug Mako templates?

python - can cherrypy receive multipart/mixed POSTs out of the box?

windows - How do I create a webpage with buttons that invoke various Python scripts on the system serving the webpage?

Using "with" statement for CSV files in Python

python - SQLAlchemy DateTime timezone

python - How to add additional information to a many-to-many relation?

python - Interpreting Excel Currency Values

Python - downloading a file over HTTP with progress bar and basic authentication

multiprocessing - Efficient layout for a distributed python server?

python - Add class to Django label_tag() output

python - Django serialize to JSON

python - Reading Command Line Arguments of Another Process (Win32 C code)

data structures - Producing documentation for Python classes

urlencode - python "'NoneType' object has no attribute 'encode'"

class - Python classes from a for loop

Porting library from Java to Python

python - Trouble with encoding in emails

python - Multithreaded Resource Access - Where Do I Put My Locks?

networking - Is there a Python library than can simulate network traffic from different addresses

python - urlsafe_b64encode always ends in '=' ?:

windows - Installing Python 3.0 on Cygwin

python - How do I use the built in password reset/change views with my own templates

python - Django and units conversion

python - PyGreSQL vs psycopg2

python - decrypting pdf protected by aes-256bit using the right password

python, sorting a list by a key that's a substring of each element

python - How can i create a lookup in Django?

python - Extracting Embedded Images From Outlook Email

oop - How to implement property() with dynamic name (in python)

python - Tidier way of trying to import a module from multiple locations?

python - Django: Increment blog entry view count by one. Is this efficient?

python - What is the difference between encode/decode?

python - Scientific libraries for Lua?

unicode() vs. str.decode() for a utf8 encoded byte string (python 2.x)

python - Algorithm to keep a list of percentages to add up to 100%

python - make a parent function return - super return?

regex - Python's re module - saving state?

python - Apps Similar to Nodebox?

Python: flush a buffer before program termination via a finalizer

python - How to gracefully deal with failed future feature (__future__) imports due to old interpreter version?

java - Re-creating threading and concurrency knowledge in increasingly popular languages

apache - Where to get/How to build Windows binary of mod_wsgi with python 3.0 support?

python - printing a list of persons with more than one home, each home with more than one phone number

python - How to access to the root path in a mod_python directory?

python web-services: returning a fault from the server using ZSI

Is a PHP, Python, PostgreSQL design suitable for a business application?

python - What are the steps to make a ModelForm work with a ManyToMany relationship with an intermediary model in Django?

python - Mysql Connection, one or many?

Resources for moving to Python

python - How to construct notes from a given song file?

python - Using user input to find information in a Mysql database

python - PIL vs RMagick/ruby-gd

authentication - What's the best way to specify a proxy with username and password for an **https** connection in python?

Using mocking to test derived classes in Python

random Decimal in python

How to (simply) connect Python to my web site?

How do I stop a program when an exception is raised in Python?

How do I convert part of a python tuple (byte array) into an integer

exception - Getting out of a function in Python

qt - How to bring program to front using python

How can I deploy a Perl/Python/Ruby script without installing an interpreter?

Tricky Python string literals in passing parameter to timeit.Timer() function

Is there a label/goto in Python?

python - Django file upload failing occasionally

How do I reverse Unicode decomposition using Python?

python - How do I retrieve a Django model class dynamically?

Python Performance - have you ever had to rewrite in something else?

How do you create a list like PHP's in Python?

python - Possible values from sys.platform?

handler - Help in FileNotFoundException -Python

python - Variable number of inputs with Django forms possible?

python - need help - bit-field conversion

regex - US-format phone numbers to links in Python

How can I check for Python version in a program that uses new language features?

python - gtk.Builder, container subclass and binding child widgets

python - Django: how do you serve media / stylesheets and link to them within templates

string - Typecasting in Python

python - How to call java objects and functions from CPython?

python - Best modules to develop a simple windowed 3D modeling application?

macos - Is there an easy way to send SCSI passthrough on OSX using native python

python - Extract float/double value

python - Is there a way to automatically generate a list of columns that need indexing?

javascript - Prototype based object orientation. The good, the bad and the ugly?

ajax - retrieving XMLHttpRequest parameters in python

python - What is the alphanumeric id in a reddit URL?

Exception handling of a function in Python

Python 3 porting workflow?

python - TKinter windows do not appear when using multiprocessing on Linux

full text search - Is there a pure Python Lucene?

Cleanest way to run/debug python programs in windows

python - dropping trailing '.0' from floats

python - Using AD as authentication for Django

Python data structure: SQL, XML, or .py file

multithreading - Implementing a buffer-like structure in Python

python - How do I send a custom header with urllib2 in a HTTP Request?

python - How to make a wx Toolbar buttons larger?

datetime - Natural/Relative days in Python

Help needed--Is class necessary in Python scripting?

String formatting in Python

python - How to convert a string of bytes into an int?

Interested in Collective Programming for the web -- Ruby or Python or PHP?

python - Storing a binary hash value in a Django model field

python - Checking 2-dimensional array (like eight queens puzzle)

debugging - How are debug consoles implemented in Python?

For Python programmers, is there anything equivalent to Perl's CPAN?

web services - HOWTO: Write Python API wrapper?

python - How can I get all rows with keys provided in a list using SQLalchemy?

How do you embed album art into an MP3 using Python?

python - How do I find out the path of the currently executing script?

python - How do I write output in same place on the console?

python - socket.shutdown vs socket.close

MySQL-db lib for Python 3.x?

python - readable list of objects

python - Safe escape function for terminal output

Using Python Web GET data

python - Duplicating model instances and their related objects in Django / Algorithm for recusrively duplicating an object

Handling output of python socket recv

python - return eats exception

javascript - Why don't Django admin "Today" and "Now" buttons show up in Safari?

python - Alter elements of a list

sql server - Python: Retrieve Image from MSSQL

python - Control 2 separate Excel instances by COM independently... can it be done?

python - IronPython Webframework

readline - How to implement a python REPL that nicely handles asynchronous output?

python - Is plotting an image on a map with matplotlib possible?

macos - What versions of Python and wxPython correspond to each version of OSX?

events - Python: Callbacks, Delegates, ... ? What is common?

java - Mixed language source directory layout

Passing functions which have multiple return values as arguments in Python

python - What should "value_from_datadict" method of a custom form widget return?

python - Is there a Vim equivalent to the Linux/Unix "fold" command?

xml - python, index errors

regex - Python Split String

python - Avoid exceptions?

Python regex: Turn "ThisFileName.txt" into "This File Name.txt"

Addressing instance name string in __init__(self) in Python

module - Python: import the containing package

python - Django template ifequal comparison of decimals

python - Is it possible to google search with the gdata API?

python - Loop function parameters for sanity check

python - pyPdf for IndirectObject extraction

python - Why does Paramiko hang if you use it while loading a module?

python - Most pythonic way to extend a potentially incomplete list

parsing - How do I split email address/password string in two in Python?

Sorting and Grouping Nested Lists in Python

What's the best way to tell if a Python program has anything to read from stdin?

python - Pythonic way to implement a tokenizer

network programming - How do you determine if an IP address is private, in Python?

python - Jython, Query multiple columns dynamically

redirect - Suppress output in Python calls to executables

python - Cocoa client/server application

python: arbitrary order by

Detect key press combination in Linux with Python?

python - How best to pass database objects to a turbogears WidgetList?

python - How to read from an os.pipe() without getting blocked?

python - Is there a way to convert number words to Integers?

multithreading - _lsprof.c profiler behaviour towards python multi-threading

python - Convert number to binary string

python - Ruby equivalent of virtualenv?

Python mailbox encoding errors

Python shelve module question

python - How to properly interact with a process using subprocess module

jquery - Using PiL to take a screenshot of HTML/CSS

python - Why do I get TypeError: can't multiply sequence by non-int of type 'float'?

python: restarting a loop

scipy - Best way to write a Python function that integrates a gaussian?

Ensuring contact form email isn't lost (python)

python - cascading forms in Django/else using any Pythonic framework

Python: Do Python Lists keep a count for len() or does it count for each call?

python - Why aren't all the names in dir(x) valid for attribute access?

python - What signals should I catch for clipboard pasting and character insertion in GTK?

Python tkinter label won't change at beginning of function

python - Does anyone have example code of using scipy.stats.distributions?

scripting - Change directory to the directory of a Python script

python - Cleaning up a database in django before every test method

python - How to know when you are in a symbolic link

user interface - Is there a Python library for easily writing zoomable UI's?

How to include page in PDF in PDF document in Python

introspection - How would you determine where each property and method of a Python class is defined?

python - What is the best approach to implement configuration app with Django?

modulo - Python quotient vs remainder

How do I set permissions (attributes) on a file in a ZIP file using Python's zipfile module?

exception - Generic catch for python

python - StaticText items disappear in wx.StaticBox

cryptography - Python M2Crypto - generating a DSA key pair and separating public/private components

parsing - Easy way to parse .h file for comments using Python?

file - python reading lines w/o \n?

python - How do I use a 2-d boolean array to select from a 1-d array on a per-row basis in numpy?

python - Privilege Escalation in Web Environment for File Access

python - Problem with encoding in Django templates

ReadInt(), ReadByte(), ReadString(), etc. in Python?

Passing self to class functions in Python

dynamic - calling methods on an instance with getattr [ python ]

python - Performance Advantages to Iterators?

httpserver - How do I create an HTTP server in Python using the first available port?

Using Python split to splice a variable together

python - How to divide a set of overlapping ranges into non-overlapping ranges?

Is Python slower than Java/C#?

python - Pre-populate an inline FormSet?

How to overwrite some bytes in the middle of a file with Python?

python - How to send a session message to an anonymous user in a Django site?

java - Python Programming - Rules/Advice for developing enterprise-level software in Python?

Difference between the use of double quote and quotes in python

How to stop a Python script without error messages on the shell?

http - A replacement for python's httplib?

Dilemma: Should I learn Seaside or a Python framework?

python - Is Google data source JSON not valid?

modem - How do you send AT GSM commands using python?

datetime - Python time to age

How do I use ctypes to set a library's extern function pointer to a Python callback function?

python - Regular expression to detect semi-colon terminated C++ for & while loops

python - abstracting the conversion between id3 tags, m4a tags, flac tags

java - Multidimensional array in Python

python - How can I order objects according to some attribute of the child in sqlalchemy?

parsing - Splitting arguments -- preserving quoted substrings -- in python

unicode - Decoding HTML Entities With Python

python - How come my class is behaving like a static class?

AUTO_INCREMENT in sqlite problem with python

Is there a single Python regex that can change all "foo" to "bar" on lines starting with "#"?

python - How to 'zoom' in on a section of the Mandelbrot set?

c++ - Is it possible to split a SWIG module for compilation, but rejoin it when linking?

data structures - Python equivalent to java.util.SortedSet?

Using the input collected from raw_input in Python

python - Why does Django only serve files containing a space?

Python: Problem with local modules shadowing global modules

python - How to implement a function to cover both single and multiple values

python - Processing XML into MySQL in good form

c# - ORM (object relational manager) solution with multiple programming language support

python - How to externally populate a Django model?

Python 2.x gotchas and landmines

dependencies - Is there a good dependency analysis tool for Python?

Can you recommend a Python SOAP client that can accept WS-Attachments?

How do I convert a string to a double in Python?

list - How to run an operation on a collection in Python and collect the results?

java - How to integrate BIRT with Python

get site name from a URL in python

python - Matching a pair of comments in HTML using regular expressions

Should I use Perl or Python for network monitoring?

How do I get the filepath for a class in Python?

django - Is there a Python equivalent of Groovy/Grails for Java

python - Deploying bluechannel with fastcgi

Parsing a file with column data in Python

python - Fast PDF splitter library

python - Django Form Preview - How to work with 'cleaned_data'

multithreading - Beginner-level Python threading problems

import - Importing in Python

python - How can I install pyCurl?

python - Why does concatenation work differently in these two samples?

python - Insert Command into Bash Shell

linker - Python dlopen/dlfunc/dlsym wrappers

python - How can I pass a filename as a parameter into my module?

import - Python includes, module scope issue

python - No code completion and syntax highlighting in Pydev

python - Django forms

optimization - What is Python's "built-in method acquire"? How can I speed it up?

sockets - BaseHTTPRequestHandler freezes while writing to self.wfile after installing Python 3.0

MSN with Python

python - Replace Nested For Loops... or not

python - How do I configure Eclipse to launch a browser when Run or Debug is selected using Pydev plugin

How do you use Binary conversion in Python/Bash/AWK?

Python xml minidom. generate <text>Some text</text> element

Next step after PHP: Perl or Python?

python - regex: Matching parts of a string when the string contains part of a regex pattern

How would you do the equivalent of preprocessor directives in Python?

string - Print method question Python

javascript - Google Apps HTTP Streaming with Python question

data structures - Multiple Tuple to Two-Pair Tuple in Python?

hash - How to set the crypto key for Python's MD5 module?

Using Python to get Windows system internals info

How to scale an image without occasionally inverting it (with the Python Imaging Library)

How do I read/retrieve emails received by local postfix, through python

python - Statistics & other add-on tools for Planet blog aggregator software

Populate a list in python

python - Guide in organizing large Django projects

python - Elixir Event Handler

python - What does the LDAP response tuple (97, []) mean?

python - Django - How to prepopulate admin form fields

python - Form Field API?

Regex replace (in Python) - a simpler way?

python - What is the pythonic way to share common files in multiple projects?

python - How do I layout a 3 pane window using wxPython?

python - Can you write a permutation function just as elegantly in C#?

python - Problem using django mptt

python - django-cart or Satchmo?

algorithm - Symbolic Mathematics Python?

Python + Django page redirect

python - pylint warning on 'except Exception:'

Python 2.6 on Windows: how to terminate subprocess.Popen with "shell=True" argument?

regex - Do Python regexes support something like Perl's \G?

python - Is there a widely used STOMP adapter for Twisted?

Python with Wiimote using pywiiuse module

python - What is the most pythonic way to make a bound method act like a function?

word wrap - Python, ROOT, and MINUIT integration?

python - How can I use named arguments in a decorator?

python - Default value for field in Django model

python - Re-raise exception with a different type and message, preserving existing information

pycxx - Python cannot create instances

python - Extracting data from MS Word

python - Extracting info from large structured text files

python - How to chain views in Django?

python - how to search for specific file type with yahoo search API?

recursion - Can a lambda function call itself recursively in Python?

python - more efficient way to pickle a string

GUI Builder for Python

python - QScintilla scrollbar

python - Strange behavior after deleting *.pyc and rerunning .py script

Closures in Python

python - Easy_install cache downloaded files

introspection - Is it possible to write to a python frame object as returned by sys._getframe() from python code running within the interpreter?

python - Google Data API authentication

Is there a way in python to apply a list of regex patterns that are stored in a list to a single string?

loops - Traverse a list in reverse order in Python

python - finditer hangs when matching against long string

python - How to distinguish between a function and a class method?

Py2exe for Python 3.0

python - Convert list of ints to one number?

How do I find the Windows common application data folder using Python?

optimization - How can I strip Python logging calls without commenting them out?

Python Script: Print new line each time to shell rather than update existing line

regex - Parsing template schema with Python and Regular Expressions

mod wsgi - What is the purpose of the sub-interpreter API in CPython?

python - Get the title of the current active Window/Document in Mac OS X

performance - Why is IronPython faster than the Official Python Interpreter

extraction - How can I extract x, y and z coordinates from geographical data by Python?

python - django facebook connect missing libs?

python - Limiting the results of cProfile to lines containing "something" _and/or_ "something_else"

python - Is there a better way (besides COM) to remote-control Excel?

How to find out the summarized text of a given URL in python / Django?

php - Some Basic Python Questions

Python - what are all the built-in decorators?

python - Validating a Unicode Name

Connecting to MySQL with Python 2.6...how?

multicore - What is LLVM and How is replacing Python VM with LLVM increasing speeds 5x?

python - How is this "referenced before assignment"?

python - How to properly organize a package/module dependency tree?

What are some common uses for Python decorators?

csv - Help with Python loop weirdness?

How to sort and remove duplicates from Python list?

python - How to parse nagios status.dat file?

svn - File editing in python

python - Can I instantiate a subclass object from the superclass

Is there a way to loop through a sub section of a list in Python





top