Here’s an interesting piece of open source code known as RTL_FM_Python for controlling the RTL-SDR dongle. “This is a Python library built upon the RTL-SDR project and allows you to use the RTL-SDR dongle to tune in arbitrary stations either with a simple web application running on a built-in server, or programmatically with Python or any language using the REST API provided.”
The code is available on GitHub.
Via RTL-SDR.com.