O'Reilly logo

Rapid GUI Programming with Python and Qt: The Definitive Guide to PyQt Programming by Mark Summerfield

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

18. Networking

Currency Converter 121Image

The Python standard library has many modules that provide networking facilities. We saw one example of a standard library networking function back in Chapter 4, when we used urllib2.urlopen() to provide a “file handle” to a file on the Internet that we then read line by line using the for line in fh: idiom. It is also possible to just “grab” an entire file from the Internet:

source = "http://www.amk.ca/files/python/crypto/" + \         "pycrypto-2.0.1.tar.gz"target = source[source.rfind("/") + 1:]name, message = urllib.urlretrieve(source, target)

The name holds ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required