Welcome To Snipplr


Everyone's Recent Snippets Tagged python



Recently I needed to capture a JSON feed of the top artists from Last.fm. The script makes a request for a JSON response which I later treat as a dictionary object. You'll probably need to sign up for an API Key before using this script
0 444 posted 9 years ago by chrisaiv
Django's middleware for global app login. With this middleware you don't have to decorate views by login_required decorator.
0 388 posted 9 years ago by lukasvinclav
Example of some random number generation mechanisms built-in Python. More details in the following link: http://docs.python.org/library/random.html
0 327 posted 10 years ago by denakitan
Basic thread example showing how to create a class inheriting from threading.Thread class. For more information, take a look at the following links: http://docs.python.org/library/thread.html http://docs.python.org/library/threading.html http://www.i...
0 293 posted 10 years ago by denakitan
Reference of simple operations with dates, such as formatting and arithmetic.
0 355 posted 10 years ago by denakitan
Snippet to verify whether or not a key exists in a python dictionary.
0 266 posted 10 years ago by denakitan
0 323 posted 10 years ago by eazyigz
2 391 posted 10 years ago by blackthorne
This is based on the JavaScript snippet at the snipplr URL listed. It in turn referenced a page that is no longer available. So I have decided to make my pythonification of the JavaScript available for others instead of hoarding it.
0 329 posted 10 years ago by hlongmore
0 524 posted 10 years ago by ronakpatel2006
Hard-coding absolute paths is never ideal so here's a quick way to reference your project folder
0 298 posted 10 years ago by chrisaiv
This context manager restores the value of the current working directory (cwd) after the enclosed code block completes or raises an exception. If a directory name is supplied to the context manager then the cwd is changed prior to running the code b...
0 368 posted 10 years ago by ches
0 295 posted 10 years ago by kidrock
Created to have a LEO editor file upload itself to dropbox. Just replace your dropbox email in the script. The script will ask you the name of the file without the extension, then will ask for your password and finally it uploads the file.
0 257 posted 10 years ago by eristoddle
0 253 posted 10 years ago by eristoddle
0 281 posted 10 years ago by eristoddle
0 449 posted 10 years ago by eristoddle
0 360 posted 10 years ago by themoosemind
0 238 posted 10 years ago by alejandrombernardis
0 309 posted 10 years ago by silviud
I only did some improvements over another snippet.
0 362 posted 10 years ago by alvarohurtado84
0 243 posted 10 years ago by kylewu
1 303 posted 10 years ago by kylewu