Skip to content

Instantly share code, notes, and snippets.

View donlovett's full-sized avatar

Don Lovett donlovett

  • ProjectBits Consulting
  • 20191
View GitHub Profile
@donlovett
donlovett / assign2_geojson.py
Created September 25, 2016 03:13
Final Assignment Week 6 Geojson
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'
url = 'http://64.137.250.177/comments_318174.json'
mycounter = 0
mysum = 0
countval = 0
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:
@donlovett
donlovett / assign2_emaildb.py
Created September 30, 2016 03:36
Coursera Python DB Course Week2 Assignment 2
import sqlite3
conn = sqlite3.connect('orgdb.sqlite')
cur = conn.cursor()
dnsmapping = dict()
cur.execute('''
DROP TABLE IF EXISTS Counts''')
cur.execute('''
@donlovett
donlovett / test.md
Last active August 8, 2022 14:36
Hello World Markdown

Hello World

This is content converted from Markdown!

Here's a JSON sample:

{
  "foo": "bar"
}
@donlovett
donlovett / test.html
Created August 8, 2022 14:37
Hello World Html
<html>
<head>
<style>
h1 {
font-family: Calibri;
}
</style>
</head>
<body>
<h1>Hello World!</h1>