Main Content
Json load from URL, recursive display, Python 3.4 Archive - Originally posted on "The Horse's Mouth" - 2015-10-14 19:17:39 - Graham Ellis
Reading a json object from a remote URL (or it that's not available from a local file), displaying the contents of the object, modifying it, and printing it out. A Python 3.4 example from today's Python course . See [here] for full source code.
Note that in Python 2, you would have used urllib2 which replaced the earlier urllib - but the name urllib has come back in Python 3 as the new "all singing, all dancing" URL accessor.
Some other articles
Y115 - Additional Python Facilities Some gems from Intermediate Python Command line parameter handling in Python via the argparse module This article Running an operating system command from your Python program - the new way with the subprocess module Json is the new marshall, pickle and cPickle / Python Python - an interesting application Handling JSON in Python (and a csv, marshall and pickle comparison) JSON from Python - first principles, easy example Teaching dilemma - old tricks and techniques, or recent enhancements? A demonstration of how many Python facilities work together Python regular expressions - repeating, splitting, lookahead and lookbehind Joining a MySQL table from within a Python program Factory methods and SqLite in use in a Python teaching example Running operating system commands from your Python program Python decorators - your own, staticmethod and classmethod Model - View - Controller demo, Sqlite - Python 3 - Qt4 Connecting Python to sqlite and MySQL databases Regular Expressions in Python Python - what is going on around me? Python - how it saves on compile time Serialization - storing and reloading objects Testing code in Python - doctest, unittest and others Python Regular Expressions A series of tyre damages Ignore case in Regular Expression Regular expressions made easy - building from components Turning objects into something you can store - Pickling (Python) Buffering output - why it is done and issues raised in Tcl, Perl, Python and PHP Sending an email from Python Python - listing out the contents of all variables Python 3000 - the next generation Keeping your regular expressions simple Python to MySQL Splitting the difference What and why for the epoch Examples - Gadfly, NI Number, and Tcl to C interface The elegance of Python Y202 - Python on the Web This article Which (virtual) host was visited? Tuning Apache log files, and Python analysis Quick and easy - showing Python data hander output via a browser Counting Words in Python via the web Handling nasty characters - Perl, PHP, Python, Tcl, Lua Moodle, Drupal, Django (and Rails) Pieces of Python FTP - how to make the right transfers Robust checking of data entered by users Crossfertilisation, PHP to Python