Home
My Faqts
Contributors
About
Help
News: Faqts.com
search
is now functional again. Thank you for your patience.
faqts
:
Computers
:
Programming
:
Languages
:
Python
: Snippets
+ Search
Enter your search terms
Submit search form
Web
faqts.com
Folders
Arrays
(3)
Databases
(6)
Date / Time
(2)
Deep Magic
(2)
Dictionaries
(20)
Lists
(26)
Maths
(20)
Modules
(1)
Network Tools
(4)
Regular Expressions
(11)
Sorting
(2)
Stream Manipulation
(17)
Strings
(19)
Tkinter
(21)
Trees
(1)
Tuples
(1)
Web Programming / Manipulating HTML files
(16)
os.*
(1)
Links
Python Cookbook (lots of great snippets!)
Share Your Knowledge
Ask a Question
Questions
Recently Asked Questions
How can we compare the values of a Dictionar to values of a list?
How can I append an item to a list and find out its index?
How can i delete list if its belong to another one, e.g ['1234\n', '34\n']
How many files have been modified in the last 7/30/60/90/etc. days? How large are they?
How do I extract a part of a string, e.g. all letters from second to fifth?
Random Questions
A sorted list
Intersection of multiple lists/lists of lists
List of references
Extracting tuple values from a dictionary
How to copy lists and dictionaries?
Printing % literally
Extended slicing
Parsing sys.version
Importing modules in JPython
Obfuscated Python
Obfuscated single-line scripts
Obfuscated IP-decoder
os.path.split() with DOS path names
Enumeration (was: Parsing chemical formula)
Creating class instances in batch
Currying
Using Perl-like flags
Finding an instance's class
Using __init__.py
while r.readline()... construction
Problems with frand()
Strip newline without losing implied space
Possix access() and ttyname() missing?
pydoc (easy doc generation)
Generating bytecode
Help with first Python program
Specifications for SYLK format
Boolean type
Assistance on first program (molecular mass)
Machine precision in Python
Better "apply" function
Sub last match
Block structure parser
Normalizing pathname
Normalizing pathname
Filename utility routine (drives)
New (?) suggestion to solve "assignment-in-while" desire
Fast intersect, unique, ...
Parsing chemical formula
UserFile module
Trouble with complexes
Little examples of OO code in Python
Reducing redundant answers (was: strings in lists)
print non-symmetry?
Finding directory of script
Docstring-driven testing [LONG]
Boolean type
Python and the Singleton Pattern
Cascading IFs for re.match
Simple color class example
Time complexity of dictionary insertions
How to obtain an instance's name at runtime?
How do you make clickable Python/Win9x scripts?
Bresenham Line Algorithm
Changing instance methods
Enum (was: Parsing chemical formula)
Turning indented text into a list of tree structures
Preprocessor (with Python as macro language)
Delayed command class
Examing file using COM/PythonWin
Pivot class
Getting doc strings from module
Enumerations (was: parsing chemical formula)
Enumerations (was: Parsing chemical formula)
Getting the module name from a method
Fully qualified hostname
Calling a function with arguments in a tuple
Passing keyword arguments from one method to another
Delegation
Accessing RPM files
XML beautifier
Variable superclasses?
IntVar - to detect a change in it
Exit code of executed program (was: Newbie question...)
RGB-color class
bitcount
CRC-16 function
DirectoryList class
Look up stock quotes
Source line number for log purpose
Memoized function (was: Lesser evil hack? (static data))
New use for __ names (calling methods only from specific class)
List of pids running a program
Recursive "touch"
Printing longs
Variable 'superclass'es?
Getting memory information under NT
Lineno and filename in exceptions
Pathnames on Windows
RFC compliant mimetools...
How do I shell-out on Win32 systems with Python?
JaPy - Just another Python hacker
re question
Non-file-based web server?
Emulating C++ coding style
YAS to the "Reading line-by-line" problem
Detecting own computer's IP
COM interface to Word (was: Stuck on ~)
WindowMaker menu classes
Language detection module
Cached class (was: Could an object delegate itself into another?)
Binary pickle replacement (was: pickle->zlib->shelve)
Any way to know when the program is exiting?
Cached class (was: Could an object delegate itself into another?)
Read one key press
Set class
Python implementation of tar
Euclid's algoritm for greatest common denominator
Lazy sequences (was: Readlines(N))
"listable" functions
Look up stock quotes
Using win32com without registry (magic_import)
Showing docstrings of modules
Metric conversions
Python mimics Morphic
Merge / Reading from file / Assignment expression
Utility for creating fonts.scale files from AFM files
Mutable function arguments (was: Interesting thread...)
Equivalent of enum
Matrix class and functions
Converting file names with "%xx" in them
Non-blocking I/O
What is the name of the function/method that called me?
Perl problem in Python
Executing binaries...?
Record separators in files
Getting time and date of OS
Options class
Pretty-printing Python interactive output?
JPython double buffered applet (was: JPython, getting started)
Unsorting (randomizing) a sequence
Unsorting (randomizing) a sequence
Static methods (was: Threading question)
Requiring arguments to be passed as keyword arguments
RSA Cryptosystem
Getting platform information on Windows NT
Search (match) backward
from (some module) import *
Getting all class/instance methods (was: dir and java classes)
Catching signals/alarm (was: Problems with signals & exceptions...)
Roman numerals
Zero-filling a number
Unloading modules (was: Developing and testing modules live)
Stack class
New urlencode (was: urllib.urlencode small improvement)
Nice floating point number formatting
Self-registering objects
Simple xmgrace Python interface
How can I make my assertions smarter?
How can I make my assertions smarter?
Running a program in the background (was: os.popen() and (IDLE, PythonWin) ?)
Getting the current line number
Reading and writing .lnk files
Telnet client for Win32
Reading comma/space-delimited files
Template for CGI
Printing on a Windows workstation
ASCII delimited files
print "foo", without a space
Setting user priviliges (was: Running a program as another user on Win32)
ASCII delimited files
Windows file version comparison
.dll and .exe file version information
ASCII delimited files
ASCII delimited files
Writing pixels / creating greyscale ramp
urllib.getsize()
Creating Windows shortcuts (.lnk)
Formatting text into columns
list.without() (Removing element from list)
ASCII delimited files
Outlining numbers with zeroes
Function which knows who has called it
Function which knows who has called it
Weak references
Unmimify
Obfuscated signature (self-reproducing)
Permutations
Matching multiline patterns
Computing attributes on the fly (class properties)
Read one key press
Behavior injection
Tensors
Circular references
Caml-like functions in Python
Singleton pattern
Singleton pattern
Singleton pattern
Converter space indentation -> tab indentation
Find sublist with sum X (was: Online programming contest)
Converter space indentation -> tab indentation
Rules system
Order of keyword arguments
Visitor design pattern for Python objects
How to put wxGrid into wxPanel?
Getting all methods of a class (was: dir() and property list)
Describing functions, methods, classes
Binding instance variables to methods (was: Method objects question)
Simple module for formatting text into columns
Automatic "lotjes trekken"
Threading and timeouts
Syntax checker
Incrementing integers (was: Python complaints)
Generating combinations (was: Automatic "lotjes trekken")
Proxy class (was: use UserDict for class __dict__)
Smarter assertions
Iterator class
Syntax checking & catching exceptions
Context information when error occurs
Converting data to little endian
JPython-compatible re.findall
JPython-compatible re.findall
Displaying colors in X-Windows
Assign a value to another variable through a method
Encoding/decoding base X
Utilities for reading config files (was: Reval builtin)
Getting files in directory (was: Directories)
Printing exception traceback to stdout
Getting Windows version
IEEE module
Obfuscated hex dumper
Printing from Python on Windows
Reval builtin
Sub last match
Python poetry (why indentation?)
checkappend.py -- search for multi-argument .append() calls
const in Python
Checking suspicious functions
enumeration/iteration wrappers/idioms
How to send binary file attachment?
getch()
Smalltalk-like 'super' (was: Python aka. Smalltalk Lite?)
papply (was: A little present)
preapply
Rudimentary dict (RFC 2229) client library
Fun with lazy streams
whois client
Self Nanny
Getting process ID
Clean emacs Python shell output
'du' in Python
Formatted printing of numbers with significant digits
What is the standard way of compiling a source file into bytecode?
How do I hide my key typing while entering a password?
Setting Focus in Pmw.Dialog
How do I change a file's last modified date
could python be made to open an e-mail client and have it send mail?
How do i connect to a database in Unix using python
how do you take a unicode string like u"レーザー" and convert it into \uXXXX escape code?
If stereo WAV file's both channels are identical, change format to mono for all files recursively
How can I advance/regress in a for loop?
Distance algorithm for fuzzy string matching (Levenshtein distance)
How many files have been modified in the last 7/30/60/90/etc. days? How large are they?
Unanswered Questions
How can I capture the copy and paste event in MS Word?
Printing on Suse Linux Server not using system calls like lpr command
Please any algoritm for FuzzySearch ..., as FuzzySearch.pas component in Delphi