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 urllib.request | |
| import urllib.error | |
| import time | |
| from multiprocessing import Pool | |
| import sys | |
| import os | |
| start = time.time() | |
| countries = ['us', 'hk', 'ch'] | |
| file = open('link', 'r') |
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 urllib.error | |
| import ssl | |
| from urllib.parse import urljoin | |
| from urllib.parse import urlparse | |
| from urllib.request import urlopen | |
| import RPi.GPIO as GPIO | |
| import time | |
| import sqlite3 | |
| import datetime |
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
| #!/usr/bin/env python | |
| from __future__ import print_function | |
| import os.path | |
| from googleapiclient.discovery import build | |
| from google_auth_oauthlib.flow import InstalledAppFlow | |
| from google.auth.transport.requests import Request | |
| from google.oauth2.credentials import Credentials | |
| SCOPES = ['https://www.googleapis.com/auth/drive','https://www.googleapis.com/auth/drive.file'] |
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
| # Finding the date in a list of files | |
| import os | |
| import glob | |
| import re | |
| files = [] | |
| months_in_numbers_small = {'jan':1,'feb':2,'mar':3,'apr':4,'may':5,'jun':6,'jul':7,'aug':8,'sep':9,'oct':10,'nov':11,'dec':12} | |
| for file in glob.glob("*.pdf"): | |
| files.append(file) |
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.multipart import MIMEMultipart | |
| from email.mime.text import MIMEText | |
| my_address = "<SENDER_EMAIL>" | |
| s = smtplib.SMTP(host="<SMPTP_HOST_OF_SENDER_EMAIL", port=587) # the mail server port is usually 587 change according to need | |
| s.starttls() | |
| s.login(my_address, "hariom123@Note") |
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 | |
| import glob | |
| from PyPDF2 import PdfFileMerger | |
| pdfs = [] | |
| for file in glob.glob("*.pdf"): | |
| pdfs.append(file) | |
| pdfs.sort() | |
| merger = PdfFileMerger() |
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 | |
| import glob | |
| files = [] | |
| for file in glob.glob("*.ppt*"): #ppt* so that we can include pptx files as well | |
| files.append(file) | |
| files.sort() | |
| for file in files: | |
| print(f"Converting {file} to pdf....") |