Skip to content

Instantly share code, notes, and snippets.

@macolyte macolyte/
Last active Dec 25, 2015

What would you like to do?
import re
import os
import sys
import webbrowser
from dropboxlogin import get_client
client = get_client()
f = client.get_file('/path/to/Library.txt')
books ='\n')
template = '.*(%s).*'
query = sys.argv[1]
# I ganked this from
regex = re.compile((template % query), re.IGNORECASE)
results = [ for l in books for m in [] if m]
if results:
content = """
<table border=1>
""".format(rows = "\n".join(['<tr>\n\t<td>{0}</td>\n\t<td>{1}</td>\n</tr>'.format(*i.split('\t')) for i in results]))
content = """
<p>No results found</p>
html = """
<title>Search Results</title>
with open("results.html", 'w') as f:
pth = "file:///" + os.path.join(os.path.dirname(os.path.abspath(__file__)), "results.html")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.