Skip to content

Instantly share code, notes, and snippets.

import requests
from multiprocessing import cpu_count
from concurrent.futures import ThreadPoolExecutor
print(f'my cpu count is {cpu_count()}')
from datetime import datetime
gameIds = [718136, 718106, 718096, 718080, 718067, 718054, 718047, 718013, 717913, 717895, 717882]
#gameIds = [718136, 718106, 718096, 718080, 718067, 718054, 718047, 718013, 718008, 717988, 717968, 717956, 717938, 717937, 717924, 717913, 717895, 717882, 717859, 717845, 717835, 717822, 717805, 717783, 717771, 717752, 717738, 717728]
import boto3
from datetime import datetime, timedelta
import pandas as pd
from openpyxl import Workbook
from openpyxl.utils import get_column_letter
from openpyxl.styles import Font, PatternFill
from openpyxl.worksheet.table import Table, TableStyleInfo
def get_resource_name(resource_id):
import requests
from bs4 import BeautifulSoup
from pprint import pprint
#import re
import pandas as pd
baseurl = 'https://www.pro-football-reference.com'
year = 2021
playerDataFile = f"playerData_{year}.csv"
#ffFile = 'fffile.csv'
import requests
from bs4 import BeautifulSoup
url = 'https://www.pro-football-reference.com'
year = 2021
r = requests.get(url + '/years/' + str(year) + '/fantasy.htm')
soup = BeautifulSoup(r.content, 'html.parser')
parsed_table = soup.find_all('table')[0]
#print(parsed_table)
@sakamer71
sakamer71 / hello.py
Created April 15, 2022 19:08
my hello
print('hello')
#!/usr/bin/env python
## PEP8 says pick a variable naming convention, and stick to it
#### mixed case for variables
#### underscores for functions
#### double and single quotes are interchangeable - use the one which will look cleanest
import os
import collections
words = ''
checkWord = ''
@sakamer71
sakamer71 / aticreek.py
Created September 13, 2015 14:45
template for ati creek
__author__ = '502400200'
from random import random,randint,randrange
pcount = 40
multrange = 13
divrange = 144
levels = list('ghijklmnopqrstuvwxyz')
print levels
def check_level():
@sakamer71
sakamer71 / testmygif.html
Created March 3, 2015 01:30
animated gif on mouseover
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Animated Gif Test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript">
@sakamer71
sakamer71 / find_next_prime
Created January 12, 2015 18:54
finding next prime - for rmotr
### Assignment ###
#
# Your assignment is to implement the
# following function: `find_next_prime`.
# As the name states, given the number `n` the
# function should return the next closest prime.
#
# Examples:
# * `find_next_prime(6)` should return 7.
# * `find_next_prime(10)` should return 11.
@sakamer71
sakamer71 / gist:13d8983bf78133ac0c40
Created December 2, 2014 02:26
speech recognition
__author__ = 'skamer'
import speech_recognition as sr
from os import system
r = sr.Recognizer()
def talk(x):
phrase = "say -v samantha \"{}\"".format(x)
return system(phrase)
def listen(x):