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
| options: | |
| r=read, | |
| w=write (change old data to new data), | |
| rb/wb=read/write-binaryy (for binary files), | |
| a=append(add new data to old data). |
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 os | |
| def main(): | |
| i = 0 | |
| source_dir = input('folder path: ') | |
| with os.scandir(source_dir) as entries: | |
| for entry in entries: | |
| i += 1 | |
| print(f'{i} :: {entry.name}') |
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 smtplib | |
| from email.mime.text import MIMEText | |
| from passwords import EMAIL, EMAIL_APP_PASSWORD | |
| def send_email(message): | |
| sender = EMAIL | |
| recipient = EMAIL | |
| password = EMAIL_APP_PASSWORD |
NewerOlder