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
| 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) |
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 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() |
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
| # 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:]: |
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 sqlite3 | |
| conn = sqlite3.connect('entries.db') | |
| cursor = conn.cursor() | |
| cursor.execute("""CREATE TABLE entries (date text, entry text)""") | |
| conn.commit() | |
| conn.close() |