This is content converted from Markdown!
Here's a JSON sample:
{
"foo": "bar"
}
<html> | |
<head> | |
<style> | |
h1 { | |
font-family: Calibri; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Hello World!</h1> |
import sqlite3 | |
conn = sqlite3.connect('orgdb.sqlite') | |
cur = conn.cursor() | |
dnsmapping = dict() | |
cur.execute(''' | |
DROP TABLE IF EXISTS Counts''') | |
cur.execute(''' |
import urllib | |
import xml.etree.ElementTree as ET | |
#url = raw_input('Enter file: ') | |
#url = 'http://python-data.dr-chuck.net/comments_318170.xml' | |
url = 'http://64.137.250.177/comments_42.xml' | |
mycounter = 0 | |
mysum = 0 | |
while True: |
import urllib | |
import json | |
# step 1 determine file to read from the web | |
# #url = raw_input('Enter file: ') | |
#url = 'http://python-data.dr-chuck.net/comments_42.json' | |
#url = 'http://python-data.dr-chuck.net/comments_318174.json' | |
url = 'http://64.137.250.177/comments_318174.json' | |
mycounter = 0 | |
mysum = 0 | |
countval = 0 |
import urllib | |
import json | |
serviceurl = 'http://python-data.dr-chuck.net/geojson?' | |
while True: | |
address = raw_input('Enter location: ') | |
if len(address) < 1 : break | |
url = serviceurl + urllib.urlencode({'sensor':'false', 'address': address}) |
import urllib | |
import json | |
# step 1 determine file to read from the web | |
# #url = raw_input('Enter file: ') | |
#url = 'http://python-data.dr-chuck.net/comments_42.json' | |
url = 'http://python-data.dr-chuck.net/comments_318174.json' | |
mycounter = 0 | |
mysum = 0 | |
# step 2 read web info into a dictionary | |
while True: |
import urllib | |
import json | |
# step 1 determine file to read from the web | |
# #url = raw_input('Enter file: ') | |
#url = 'http://python-data.dr-chuck.net/comments_42.json' | |
url = 'http://python-data.dr-chuck.net/comments_318174.json' | |
mycounter = 0 | |
mysum = 0 | |
# step 2 read web info into a dictionary | |
while True: |
import urllib | |
import xml.etree.ElementTree as ET | |
url = raw_input('Enter file: ') | |
#url = 'http://python-data.dr-chuck.net/comments_318170.xml' | |
mycounter = 0 | |
mysum = 0 | |
while True: | |
print 'Retrieving', url |
import xml.etree.ElementTree as ET | |
#fname = raw_input('Enter the file name: ') | |
#fname = '/home/vagrant/Coursera/Week5/comments_42.xml' | |
fname = '/home/vagrant/Coursera/Week5/comments_318170.xml' | |
try: | |
tree = ET.ElementTree(file=fname) | |
print 'Retreived ',fname | |
#Retrieved 4204 characters | |
except: | |
print 'File cannot be opened:', fname |