Welcome To Snipplr
Everyone's Recent Python Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
This creates a zipfile with the same name as the input file in the same location as the input file. Only does a single file.
0
1166
posted 15 years ago by throb
Python
print a list of all the "read" nodes in a nuke script that has a "file" name containing 'mov'
print a list of all the "read" nodes in a nuke script that has a "file" name containing 'mov'
0
2864
posted 15 years ago by adamteale
ElementTree is provided as part of the standard Python libs. ElementTree is pure python, and cElementTree is the faster C implementation:
Here's an example usage, where I'm consuming xml from a RESTful web service:
0
853
posted 15 years ago by magicrebirth
Directory listing on a web server at http://yourhost:8000/
1
1048
posted 15 years ago by blackthorne
This code allows automatically posting comments to LiveJournal to be the first commenter.
Usage: $ python auto-post-comment.py
1
793
posted 15 years ago by andrewkolesnikov
First there was: [http://snipplr.com/view/15246/color-coded-svn-status](http://snipplr.com/view/15246/color-coded-svn-status)
Then there was: [http://snipplr.com/view/16540/color-coded-svn-status-v2](http://snipplr.com/view/16540/color-coded-svn-s...
0
1290
posted 15 years ago by philchristensen
Now that you have set up your ManyToManyField to use your intermediary model (Membership, in this case), you're ready to start creating some many-to-many relationships. You do this by creating instances of the intermediate model:
0
1223
posted 15 years ago by magicrebirth
Not very secure, but very handy ...
Use like that :
app = your_wsgi_app()
app = ControlAccess( app, "your_password")
httpserve( app ) # wsgi server
0
1206
posted 15 years ago by manatlan
A simple python script for taking all files in the base dir and encoding them (and than removing them) into another folder. Handbrake, quality based, ipod nano compatible video, mac or windows.
0
960
posted 15 years ago by OtonVM
Found on [Corey Goldberg's blog](http://coreygoldberg.blogspot.com/2010/01/python-command-line-progress-bar-with.html). Usage:
from progress_bar import ProgressBar
p = ProgressBar(60)
p.update_time(15)
print p
p.fill_char =...
0
708
posted 15 years ago by ctmiller
Originally found on [Corey Goldberg's blog](http://coreygoldberg.blogspot.com/2010/01/python-command-line-progress-bar-with.html)
0
844
posted 15 years ago by codeshaman
This function takes a list of string and sorts them based on their similarity. The percent at which they match can be defined in the second parameter (default 75%).
0
1356
posted 15 years ago by gdvickery