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
# SQL_CODE | |
# SELECT NOME FROM PESSOAS | |
# SQL_CODE | |
cursor = [('Reinaldo',), ('João',), ('Fábio',), ('Ryan',)] # Exemplo de um CURSOR do SQL_CODE | |
# for aninhado (SEM List Comprehension) | |
nomes = [] |
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 restart_code(): | |
import sys | |
import os | |
python = sys.executable | |
os.execl(python, python, *sys.argv) | |
restart_code() | |
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
# Extraido de https://raccoon.ninja/pt/dev-pt/tabela-de-cores-ansi-python/ | |
# Funciona bem no Pycharm... | |
REMOVIDO_DE = 'https://raccoon.ninja/pt/dev-pt/tabela-de-cores-ansi-python/' | |
print('Site de onde foi removido as informações: \n' | |
f' {REMOVIDO_DE}\n') | |
# Preto | |
print('\033[1;30mSEU_TEXTO\033[m') # (Fonte / Letras) |
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 time | |
from datetime import date | |
while True: | |
# A data tem que vir para a função nesse formato: "24/12/2021" | |
''' | |
Essa função verifica se a data | |
que o usuário digitou é maior | |
ou igual que a data atual do sistema | |
''' |
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
''' | |
a função velocidade recebe outra função como parâmetro | |
a função velocidade tem uma função chamada interna que | |
recebe argumentos não nomeados e argumentos nomeados (não sabendo a qtd de argumentos) | |
e a funcao interna vai retornar e executar a funcao que vem do parametro da funcao velocidade | |
e a funcao velocidade vai retornar a interna sem executar | |
def velocidade(funcao): | |
def interna(*args, **kwargs): | |
funcao(*args, **kwargs) |
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 selenium.webdriver import Chrome | |
from time import sleep | |
url = 'https://curso-python-selenium.netlify.app/exercicio_01.html' | |
browser = Chrome() | |
browser.get(url) | |
sleep(4) | |
titulo = browser.find_element_by_tag_name('h1') # pega o titulo (no text) | |
dicio = {titulo.text: 'Vazio'} # cria um dict com o titulo |
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 selenium.webdriver import Firefox | |
from time import sleep | |
url = 'https://curso-python-selenium.netlify.app/exercicio_02.html' | |
driver = Firefox() | |
driver.get(url) | |
sleep(4) | |
list_ps = driver.find_elements_by_tag_name('p') | |
# achando o p que tem o número esperado: |
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
''' | |
1 pegar todos os links das aulas | |
{'nome da aula': 'link da aula' } | |
2 navegar até o exercicio 3 | |
achar a url do ex 3 e ira até la | |
''' | |
from email.quoprimime import body_check | |
from importlib.resources import path | |
from time import sleep |
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 time import sleep | |
from selenium.webdriver import Chrome | |
chrome = Chrome() | |
chrome.get('https://selenium.dunossauro.live/aula_05.html') | |
sleep(1) | |
# names= nome, email, senha, telefone, btn |
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
""" | |
Faça uma lista de tarefas com as seguintes opções: | |
adicionar tarefa | |
listar tarefas | |
opção de desfazer (a cada vez que chamarmos, desfaz a última ação) | |
opção de refazer (a cada vez que chamarmos, refaz a última ação) | |
['Tarefa 1', 'Tarefa 2'] | |
['Tarefa 1'] <- Desfazer | |
['Tarefa 1', 'Tarefa 2'] <- Refazer | |
input <- Nova tarefa |
OlderNewer