<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/language/python/tags/python</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Tue, 21 May 2013 20:56:50 GMT</pubDate>
<item>
<title>(Python) Objectjson - JSON to nested object. - plainwreck</title>
<link>http://snipplr.com/view/71218/objectjson--json-to-nested-object/</link>
<description><![CDATA[ <p>Makes working with JSON data, in my eyes, easier in Python.

Instead of

    json_data['key']['key']['key']

Do

    json_data.key.key.key

This can also be modified to work the same way with dict types.</p> ]]></description>
<pubDate>Fri, 17 May 2013 23:23:24 GMT</pubDate>
<guid>http://snipplr.com/view/71218/objectjson--json-to-nested-object/</guid>
</item>
<item>
<title>(Python) Email to HTML Script - drydenlong</title>
<link>http://snipplr.com/view/71177/email-to-html-script/</link>
<description><![CDATA[ <p>A script to parse emails and return HTML suited for email blast programs</p> ]]></description>
<pubDate>Wed, 15 May 2013 03:59:49 GMT</pubDate>
<guid>http://snipplr.com/view/71177/email-to-html-script/</guid>
</item>
<item>
<title>(Python) LJAutoComment - aruseni</title>
<link>http://snipplr.com/view/71026/ljautocomment/</link>
<description><![CDATA[ <p>This class is used to automatically update a LiveJournal blog’s RSS feed, detect new entries and post a comment if the entry is new enough (i.e. is posted in a given period of time from now, for example not older than 1 hour)

**Example:**

    comment = u"Первый комментарий."

    engine = LJAutoComment('http://asena.livejournal.com/data/rss', 'user', 'password', comment, 1)
    engine()</p> ]]></description>
<pubDate>Fri, 03 May 2013 00:08:51 GMT</pubDate>
<guid>http://snipplr.com/view/71026/ljautocomment/</guid>
</item>
<item>
<title>(Python) Scrape list of all NBA players - asimmittal</title>
<link>http://snipplr.com/view/70949/scrape-list-of-all-nba-players/</link>
<description><![CDATA[ <p>This is a python script that allows you to scrape historical player names and links from NBA.com historical data</p> ]]></description>
<pubDate>Sun, 28 Apr 2013 16:33:43 GMT</pubDate>
<guid>http://snipplr.com/view/70949/scrape-list-of-all-nba-players/</guid>
</item>
<item>
<title>(Python) Replace procedural Nuke Write paths with real paths in write node by replacing the write node(s) - throb</title>
<link>http://snipplr.com/view/70898/replace-procedural-nuke-write-paths-with-real-paths-in-write-node-by-replacing-the-write-nodes/</link>
<description><![CDATA[ <p>This allows you to take a node that has expressions in it and create copies of them that are hard pathed.  It will also disable said expression driven write nodes and disable them.</p> ]]></description>
<pubDate>Tue, 23 Apr 2013 13:41:33 GMT</pubDate>
<guid>http://snipplr.com/view/70898/replace-procedural-nuke-write-paths-with-real-paths-in-write-node-by-replacing-the-write-nodes/</guid>
</item>
<item>
<title>(Python) Synesthor Thinks (get a color from colorrrs.com) - nerdfiles</title>
<link>http://snipplr.com/view/69762/synesthor-thinks-get-a-color-from-colorrrscom/</link>
<description><![CDATA[ <p>alias synesthor_thinks="py /Users/nerdfiles/Tools/colorrrs/colorrrs.py | pbcopy"</p> ]]></description>
<pubDate>Sat, 02 Feb 2013 08:18:26 GMT</pubDate>
<guid>http://snipplr.com/view/69762/synesthor-thinks-get-a-color-from-colorrrscom/</guid>
</item>
<item>
<title>(Python) Clean files/directory by time. - djmornyc</title>
<link>http://snipplr.com/view/69118/clean-filesdirectory-by-time/</link>
<description><![CDATA[ <p>*Does not check permissions.
python cleanFiles.py --directory=/home/win98/tmp/ --ageInDays=2</p> ]]></description>
<pubDate>Sat, 15 Dec 2012 02:15:21 GMT</pubDate>
<guid>http://snipplr.com/view/69118/clean-filesdirectory-by-time/</guid>
</item>
<item>
<title>(Python) batch accounts  import  into discuz with python - dylanninin</title>
<link>http://snipplr.com/view/68951/batch-accounts--import--into-discuz-with-python/</link>
<description><![CDATA[ <p>batch accounts  import  into discuz with python</p> ]]></description>
<pubDate>Tue, 04 Dec 2012 22:23:05 GMT</pubDate>
<guid>http://snipplr.com/view/68951/batch-accounts--import--into-discuz-with-python/</guid>
</item>
<item>
<title>(Python) Python main with options - ssoton</title>
<link>http://snipplr.com/view/68825/python-main-with-options/</link>
<description><![CDATA[ <p>Snippet to show how works optparse module to add optoins when it is called by command line</p> ]]></description>
<pubDate>Thu, 29 Nov 2012 21:53:43 GMT</pubDate>
<guid>http://snipplr.com/view/68825/python-main-with-options/</guid>
</item>
<item>
<title>(Python) Filter Signals using scipy - leonpalafox</title>
<link>http://snipplr.com/view/68771/filter-signals-using-scipy/</link>
<description><![CDATA[ <p>This portion of code allows to do bandpass filtering over time series</p> ]]></description>
<pubDate>Mon, 26 Nov 2012 22:34:26 GMT</pubDate>
<guid>http://snipplr.com/view/68771/filter-signals-using-scipy/</guid>
</item>
<item>
<title>(Python) Flask - The Basics - denakitan</title>
<link>http://snipplr.com/view/68733/flask--the-basics/</link>
<description><![CDATA[ <p>Snippet showing a simple Flask application to illustrate the topics covered in the "Quickstart".</p> ]]></description>
<pubDate>Sat, 24 Nov 2012 00:22:31 GMT</pubDate>
<guid>http://snipplr.com/view/68733/flask--the-basics/</guid>
</item>
<item>
<title>(Python) Appindicator facade - ssoton</title>
<link>http://snipplr.com/view/68709/appindicator-facade/</link>
<description><![CDATA[ <p>snippet to show appindicator problem</p> ]]></description>
<pubDate>Thu, 22 Nov 2012 22:17:25 GMT</pubDate>
<guid>http://snipplr.com/view/68709/appindicator-facade/</guid>
</item>
<item>
<title>(Python) Python simple thread manager - ytech</title>
<link>http://snipplr.com/view/68634/python-simple-thread-manager/</link>
<description><![CDATA[ <p>A python static class that handles simple thread management.</p> ]]></description>
<pubDate>Sun, 18 Nov 2012 08:55:20 GMT</pubDate>
<guid>http://snipplr.com/view/68634/python-simple-thread-manager/</guid>
</item>
<item>
<title>(Python) Python - Basic Main Structure - denakitan</title>
<link>http://snipplr.com/view/67927/python--basic-main-structure/</link>
<description><![CDATA[ <p>Extremely simple snippet showing the basic structure of a Python program.</p> ]]></description>
<pubDate>Thu, 25 Oct 2012 05:06:19 GMT</pubDate>
<guid>http://snipplr.com/view/67927/python--basic-main-structure/</guid>
</item>
<item>
<title>(Python) Simple IRC bot with SSL - zhyar</title>
<link>http://snipplr.com/view/67553/simple-irc-bot-with-ssl/</link>
<description><![CDATA[ <p>This is a simple IRC bot connecting with SSL.</p> ]]></description>
<pubDate>Mon, 01 Oct 2012 22:02:46 GMT</pubDate>
<guid>http://snipplr.com/view/67553/simple-irc-bot-with-ssl/</guid>
</item>
<item>
<title>(Python) Example of web parser - zhyar</title>
<link>http://snipplr.com/view/67552/example-of-web-parser/</link>
<description><![CDATA[ <p>Simple web parser using urllib and re libs.</p> ]]></description>
<pubDate>Mon, 01 Oct 2012 21:45:02 GMT</pubDate>
<guid>http://snipplr.com/view/67552/example-of-web-parser/</guid>
</item>
<item>
<title>(Python) Simple ID3 tagger - zhyar</title>
<link>http://snipplr.com/view/67550/simple-id3-tagger/</link>
<description><![CDATA[ <p>Require the ID3 lib.
Place the script in the directory containing the mp3 files.</p> ]]></description>
<pubDate>Mon, 01 Oct 2012 21:19:41 GMT</pubDate>
<guid>http://snipplr.com/view/67550/simple-id3-tagger/</guid>
</item>
<item>
<title>(Python) Random alphanumeric string generator - zhyar</title>
<link>http://snipplr.com/view/67549/random-alphanumeric-string-generator/</link>
<description><![CDATA[ <p>Returns 5 random alphanumeric strings of arbitrary size.</p> ]]></description>
<pubDate>Mon, 01 Oct 2012 21:11:10 GMT</pubDate>
<guid>http://snipplr.com/view/67549/random-alphanumeric-string-generator/</guid>
</item>
<item>
<title>(Python) Getting shovel to work in windows so python methods can be run like individual executables - pckujawa</title>
<link>http://snipplr.com/view/66267/getting-shovel-to-work-in-windows-so-python-methods-can-be-run-like-individual-executables/</link>
<description><![CDATA[ <p>I had hear about a method to run a method like an executable, with the arguments being passed in from the commandline. Apparently, Ruby has this with the Rake project. Well, Python has it with [Shovel](http://devblog.seomoz.org/2012/03/shovel-rake-for-python). Only the instructions didn't work for me on windows, so I had to create a batch script to call `shovel` correctly.

So here's my setup. I installed shovel using `easy_install shovel`, which placed it in my python scripts folder (C:\Python27\Scripts, which is in my PATH). I created 'shovel.bat' (see source) in the same folder. So now I can call `shovel` from anywhere and it will call my batch file, passing the parameters into shovel.

For completeness, here is my working directory structure (note the subfolder called shovel):

	D:.
	│   song log.log
	│   Untitled_10.mp3
	│   Untitled_11.mp3
	│   Untitled_2.mp3
	│   Untitled_3.mp3
	│   Untitled_4.mp3
	│   Untitled_5.mp3
	│   Untitled_6.mp3
	│   Untitled_7.mp3
	│   Untitled_8.mp3
	│   Untitled_9.mp3
	│
	└───shovel
	        tasks.py

My python script is incomplete but can be run by shovel using `shovel tasks.extractSongInfo "log file name.log"` from the directory above the 'shovel' directory. Here's the script:


	from shovel import task
	
	@task
	def extractSongInfo(logFile):
	    """Given a log file with lines like
	"{date}	INFO	 Currently playing - Song: {songName} - Artist: {artist} - Length: {numSeconds}"
	return a collection of extracted info."""
	    opId = "Extracting song info" # operation ID
	    print opId
	    print 'Done: ' + opId</p> ]]></description>
<pubDate>Sun, 22 Jul 2012 07:44:22 GMT</pubDate>
<guid>http://snipplr.com/view/66267/getting-shovel-to-work-in-windows-so-python-methods-can-be-run-like-individual-executables/</guid>
</item>
<item>
<title>(Python) First Window in PyQt4 - akus85</title>
<link>http://snipplr.com/view/65680/first-window-in-pyqt4/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 18 Jun 2012 00:22:50 GMT</pubDate>
<guid>http://snipplr.com/view/65680/first-window-in-pyqt4/</guid>
</item>
</channel>
</rss>