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
from bs4 import BeautifulSoup as bs | |
from urllib.request import urlopen | |
url = "https://resultado-megasena.com" | |
content = urlopen(url).read() | |
soup = bs(content, 'html.parser') | |
for i in soup.findAll('p', {'class': 'text'}): | |
for j in i.text.split('\n'): | |
if('Estes são os números ganhadores do sorteio' in j): |
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
import os, sys | |
import pydub | |
import numpy as np | |
if(len(sys.argv) != 3): | |
print(f"{sys.argv[0]} <audio file> <number of parts>") | |
sys.exit(1) | |
filename = sys.argv[1] | |
numparts = int(sys.argv[2]) |
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
#code was found here: https://github.com/arrrlo/Google-Images-Search | |
#i'm saving it as a gist for easier access | |
from google_images_search import GoogleImagesSearch | |
import sys | |
if(len(sys.argv) != 3): | |
print(f"{sys.argv[0]} <search term> <number>") | |
sys.exit() |
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
import AO3 | |
#thanks to https://github.com/ArmindoFlores/ao3_api | |
import os | |
searchterm = "SEARCH TERM" | |
search = AO3.Search(any_field=searchterm, word_count=AO3.utils.Constraint(2000, 15000)) | |
search.update() | |
numpages = int(search.total_results/20) | |
print("Total pages: " + str(numpages)) | |
print("Total results: " + str(search.total_results)) |
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
from pylab import * | |
from moviepy.editor import VideoFileClip, ImageSequenceClip | |
import random | |
import sys | |
import os | |
if(len(sys.argv) != 3): | |
print(f"{sys.argv[0]} <path> <number of images>") | |
sys.exit(0) |
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
import pandas as pd | |
import requests | |
import random | |
from pathlib import Path | |
from bs4 import BeautifulSoup as bs | |
nameurl = 'https://www.fakepersongenerator.com/' | |
s = requests.session() | |
page = s.get(nameurl) | |
soup = bs(page.text, 'html.parser') |
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
import sys, re | |
if(len(sys.argv) != 3): | |
print("{} <key 1> <key 2>".format(sys.argv[0])) | |
sys.exit(1) | |
chrom = ["a", "bb", "b", "c", "db", "d", "eb", "e", "f", "gb", "g", "ab"] | |
#harm = ["M7", "m7", "m7", "M7", "7", "m7", "dim7"] | |
harm = ["∆", "-7", "-7", "∆", "7", "-7", "ø7"] | |
st = [2, 2, 1, 2, 2, 2, 1] |
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
import sys, re | |
if(len(sys.argv) < 2): | |
print("{} <notes>".format(sys.argv[0])) | |
sys.exit(1) | |
chrom = ["a", "bb", "b", "c", "db", "d", "eb", "e", "f", "gb", "g", "ab"] | |
#change tuning here | |
#standard = ["e", "b", "g", "d", "a", "e"] | |
standard = ["d", "a", "g", "e", "a", "d"] |
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
import psutil | |
fan = psutil.disk_usage(path="/") | |
print("[DISK]") | |
print("Available: ", fan.total/1000000000, "GB") | |
print("Used: ", fan.used/1000000000, "GB") | |
print("Free: ", fan.free/1000000000, "GB") | |
print("Percentage Used: ", fan.percent, "%") | |
mem = psutil.virtual_memory() |
NewerOlder