RTL-SDR Home : www.sharetechnote.com
This example using the Python package pyrtlsdr which is available in the official site here. I used the package version 0.2.92 and Python version 3.8 on Windows 10.
NOTE 1 : To run this script, you need to get RTL-SDR driver installed and confirm working. See this page on how to install and test the driver.
NOTE 2 : This python package requires some dependancies called librtlsdr. I used librtlsdr v0.8 that you can get from here. I used the package as highlighbed below.
modify librtlsdr.py as follows :