pip install qrcode
pip install "qrcode[pil]"
from bs4 import BeautifulSoup | |
html = 'lt;p><span style="font-weight: 400;">Você não teve o e-mail pessoal criado por falta de informações, para a criação você deve abrir um novo chamado com os seguintes dados:</span></p><p><strong>CPF -</strong></p><p><strong>NOME COMPLETO - </strong></p><p><strong>MATRÍCULA -</strong></p><p><strong>CARGO -</strong></p><p><strong>TELEFONE -</strong></p><p><strong>SETOR -</strong></p>' | |
soup = BeautifulSoup(html, 'html5lib') | |
print(soup.get_text()) |
from html.parser import HTMLParser | |
class Parser(HTMLParser): | |
# method to append the start tag to the list start_tags. | |
def handle_starttag(self, tag, attrs): | |
global start_tags | |
start_tags.append(tag) | |
# method to append the end tag to the list end_tags. |
def maiuscula(funcao): | |
def wrapper(texto): # função que modifica | |
return funcao(texto.upper()) # transforma pra maiúscula | |
return wrapper # retorna a função modificadora | |
@maiuscula | |
def imprimir_mensagem(nome): | |
print(f"Olá {nome}, \nSeja bem vindo!") |
import mysql.connector | |
mydb = mysql.connector.connect( | |
host="127.0.1.1", # ip do banco | |
user="usuario", | |
passwd="senha", | |
database="banco_glpi" | |
) | |
mycursor = mydb.cursor() |
import sys | |
try: | |
if sys.argv[1] in sys.argv: # Caso exista argumento 1 | |
match sys.argv[1]: | |
case "oi": | |
print("\nOlá pessoa!") | |
case "tchau": | |
print("\nTchau, até logo!") | |
case _: |
""" | |
Exibindo comentários em ordem cronológica reversa. | |
Os mais recentes aparecem primeiro. | |
https://docs.python.org/3/howto/sorting.html | |
""" | |
comentarios = [ | |
['2023-1-29 11:03:00',"Agora entendi o problema"], | |
['2023-1-29 11:04:01',"Quase finalizando"], | |
['2022-12-29 8:32:49',"Recebi sua mensagem"], | |
['2022-12-30 4:14:58',"Ainda não entendi o problema"], |
from requests import Request, Session | |
import json | |
import time | |
import webbrowser | |
import pprint | |
def getInfo (): # Function to get the info | |
url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest' # Coinmarketcap API url |