This file contains 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 python3 | |
from email.message import EmailMessage | |
import ssl | |
import smtplib | |
# create pw here https://myaccount.google.com/u/4/apppasswords after you enable 2-factor | |
password = "SOMEPASSWORD" | |
sender = "youremail@gmail.com" |
This file contains 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 python3 | |
nums = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11] | |
# filter for prime numbers | |
prime = list(filter(lambda number: all(number % i != 0 for i in range(2, int(number**0.5) + 1)), nums)) | |
print(prime) | |
# cube them | |
cubed = list(map(lambda x: x**3, prime)) |
This file contains 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 python3 | |
import time | |
import curses | |
import os | |
import threading | |
import subprocess | |
def waitforthis(thread): |
This file contains 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 python3 | |
import time | |
import curses | |
import os | |
message = "Warning - Production" | |
loading = True | |
This file contains 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/local/bin/env python3 | |
import pandas as pd | |
from prophet import Prophet | |
from prophet.plot import plot_plotly, plot_components_plotly | |
import ssl | |
ssl._create_default_https_context = ssl._create_stdlib_context |
This file contains 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/local/bin/env python3 | |
import mysql.connector | |
# pip3 install mysql-connector-python | |
user_input = input("Enter something: ") | |
db = mysql.connector.connect( | |
host="localhost", | |
port="3306", |
This file contains 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 python3 | |
import json | |
import csv | |
csv_file_path = "/Users/user/Downloads/file.csv" | |
json_file_path = "/Users/user/Downloads/file.json" | |
def step1(csv_file_path, json_file_path): |
This file contains 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
found = 0 | |
mystring = "Code" | |
with open("inputfile.txt", "r") as input: | |
with open("outputfile.txt", "w") as output: | |
for line in input: | |
if line.startswith(mystring): | |
found = 1 | |
if found == 0: | |
pass | |
else: |
This file contains 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 python3 | |
import os | |
string2remove = ".720p.IBCTV.WEBRip.x264-GalaxyGlue" | |
edir = "/Users/user/Desktop/SomeGoodShowS01" | |
#edir = os.getcwd() | |
# Will reaname all files in the 'edir' by removing the above 'string2remove'. | |
# Example: |
NewerOlder