Skip to content

Instantly share code, notes, and snippets.

import pandas as pd
import numpy as np
import requests
from bs4 import BeautifulSoup
from time import sleep
def get_table(round, url=url):
round_url = f'{url}/{round}'
page = requests.get(round_url)
anonymous
anonymous / __init__.py.py
Created July 25, 2017 14:07
__init__.py created by britodfbr - https://repl.it/Jh4X/0
# this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
anonymous
anonymous / getopt2.py
Created July 12, 2017 14:58
getopt2 created by britodfbr - https://repl.it/JYbi/7
def calc(x,y,op):
try:
x, y = int(x), int(y)
return{
'+': x + y,
'-': x - y,
'*': x * y,
'/': x // y,
'%': x % y,
}.get(op,'Error')
anonymous
anonymous / main.py
Created July 12, 2017 14:56
getopt3 created by britodfbr - https://repl.it/JYcz/1
def calc(x,y,op):
try:
x, y = int(x), int(y)
return{
'+': x + y,
'-': x - y,
'*': x * y,
'/': x // y,
'%': x % y,
}.get(op)
anonymous
anonymous / getopt1.py
Created July 12, 2017 14:55
getopt1 created by britodfbr - https://repl.it/JYb1/1
#!/usr/bin/python3
dic = {'Name': 'Turtle', 'Age': 7}
print ("Nome : {: >14}".format(dic.get('Name', "Never")))
print ("Idade : {: >8}".format(dic.get('Age')))
print ("Escolaridade : {}".format(dic.get('Education', "Never")))
anonymous
anonymous / main.py
Created July 12, 2017 14:50
getopt4 created by britodfbr - https://repl.it/JYgN/4
from random import randint, random
from time import time
def gen_random(op):
try:
op = int(op)
yield {
1: time(),
2: random(),