Skip to content

Instantly share code, notes, and snippets.

View nt92's full-sized avatar
๐Ÿ•บ
vibin'

Nikhil Thota nt92

๐Ÿ•บ
vibin'
View GitHub Profile
@nt92
nt92 / cracklepop.py
Created December 23, 2021 23:28
Recurse Center CracklePop
def crackle_pop():
for i in range(1, 101):
output = ""
if(i % 3 == 0):
output += "Crackle"
if(i % 5 == 0):
output += "Pop"
if(output == ""):
output += str(i)
print(output)
import sqlite3
import smtplib
FROM_ADDRESS = 'nthota.testing@gmail.com'
TO_ADDRESS = 'nthota92@gmail.com'
PASSWORD = 'wouldnt_you_like_to_know'
conn = sqlite3.connect('entries.db')
cursor = conn.cursor()
# pattern matcher my date formats
def date_match(strg, search=re.compile(r'[^0-9./\- ]').search):
return strg != '' and strg != ' ' and not bool(search(strg))
# parse folder of .docx files
for file in os.listdir('./entry_files'):
document = docx.Document('./entry_files/'+file)
current_date = document.paragraphs[0].text
current_entry = ''
for paragraph in document.paragraphs[1:]:
@nt92
nt92 / create_database.py
Created May 24, 2019 17:14
Create a SQLite database with Python
import sqlite3
conn = sqlite3.connect('entries.db')
cursor = conn.cursor()
cursor.execute("""CREATE TABLE entries (date text, entry text)""")
conn.commit()
conn.close()