I should also point out that this site has some JSON code in Python.
http://www.alloscomp.com/bitcoin/Specifically this code that checks the balance and sends it to a static address.
#!/usr/bin/python
import jsonrpc
MyBCAddress = 'YOUR BITCOIN ADDRESS HERE'
b = jsonrpc.ServiceProxy("http://localhost:8332/")
bal = float(b.getbalance())
if bal > 0.01:
print "We have a balance of {0:.2f}BC. Sending...".format(bal)
b.sendtoaddress(MyBCAddress,bal)
else:
print "No coins here."