Heres a link to a scanner which will help you see how it can scan a range:

pyscan

*Disclaimer: I've worked on this project as well.