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 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) |
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
# this is a namespace package | |
try: | |
import pkg_resources | |
pkg_resources.declare_namespace(__name__) | |
except ImportError: | |
import pkgutil | |
__path__ = pkgutil.extend_path(__path__, __name__) |
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
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) |
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
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') |
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/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"))) |
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 random import randint, random | |
from time import time | |
def gen_random(op): | |
try: | |
op = int(op) | |
yield { | |
1: time(), | |
2: random(), |