This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib #importing urllib | |
import xml.etree.ElementTree as ET #importing xml library | |
url = raw_input("Enter the URL:") #requesting a xml file | |
#read the file and get the comment tag | |
data = urllib.urlopen(url).read() | |
tree = ET.fromstring(data) | |
lst = tree.findall('.//comment') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib #importing urllib | |
import json #importing json | |
#requesting a json file url | |
url = raw_input("Enter the URL:") | |
#load json file as list -info | |
info = json.loads(urllib.urlopen(url).read()) | |
x = 0 | |
#loop through each item in list comments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
import json | |
serviceurl = 'http://python-data.dr-chuck.net/geojson?' | |
while True: | |
address = raw_input('Enter location: ') | |
if len(address) < 1 : break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sqlite3 | |
conn = sqlite3.connect('emaildb.sqlite') | |
cur = conn.cursor() | |
cur.execute(''' | |
DROP TABLE IF EXISTS Counts''') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xml.etree.ElementTree as ET | |
import sqlite3 | |
conn = sqlite3.connect('trackdb.sqlite') | |
cur = conn.cursor() | |
# Make some fresh tables using executescript() | |
cur.executescript(''' | |
DROP TABLE IF EXISTS Artist; | |
DROP TABLE IF EXISTS Genre; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import sqlite3 | |
conn = sqlite3.connect('rosterdb.sqlite') | |
cur = conn.cursor() | |
# Do some setup | |
cur.executescript(''' | |
DROP TABLE IF EXISTS User; | |
DROP TABLE IF EXISTS Member; |
OlderNewer