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
# coding=utf-8 | |
import webbrowser | |
import urllib | |
import urllib2 | |
from bs4 import BeautifulSoup | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.common.keys import Keys | |
from selenium import webdriver |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 matplotlib | |
import matplotlib.pyplot as plt | |
fig = plt.figure() | |
ax = fig.add_subplot(111) | |
patch1 = matplotlib.patches.Circle( | |
[0.5,0.5],0.05 | |
) | |
patch2 = matplotlib.patches.Rectangle( | |
[0.3,0.3],0.4, 0.4, alpha=0.5, | |
fill=False, edgecolor='black', |
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
from http import server | |
import socketserver | |
import webbrowser | |
import threading | |
class ThreadingServer(socketserver.ThreadingMixIn, server.HTTPServer): | |
pass | |
PORT = 8000 |
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 re | |
import os | |
import datetime | |
import time | |
from shutil import copyfile | |
regex_filename = \ | |
'fb_([0-9]{4})-([0-9]{2})-([0-9]{2})' + \ | |
'T([0-9]{2})-([0-9]{2})-([0-9]{2})_([0-9]+).jpg' |
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 matplotlib.pyplot as plt | |
import numpy as np | |
# rho = 8 pi hc/(lambda^5 *(exp(hc/(lambda k T)))-1) | |
# x = lambda k T /(h c) | |
# T = x *(h c)/(lambda k) | |
# rho = 8 pi hc/((h c)^5/(k T)^5 * x^5 *(exp(x)-1) | |
# rho = (8 pi (k T)^5/(h c)^4)/ (x^5 *(exp(x)-1)) | |
title_text = 'Black Body Radiation' | |
n_temps = 10 | |
pi = np.pi |
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 | |
replace_str = '[replaceme]' | |
for root, dirs, files in os.walk('.'): | |
for file in files: | |
if replace_str in file: | |
new_file = file.replace(replace_str,'') | |
os.rename( | |
os.path.join(root,file), | |
os.path.join(root,new_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 os | |
import win32com.client | |
folder = os.path.abspath(u'.') | |
folder_exists = os.path.exists(folder) | |
sh=win32com.client.gencache.EnsureDispatch('Shell.Application',0) | |
ns=sh.NameSpace(folder) | |
colnum = 0 |
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 | |
from mutagen.easyid3 import EasyID3 | |
folder = os.path.abspath(u'.') | |
folder_exists = os.path.exists(folder) | |
for file in os.scandir(folder): | |
file_path = os.path.join(folder, file.name) | |
print(file_path) | |
actual_number = file.name.split('_')[0] |