pip install python-barcode
#!/usr/bin/env python
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 |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<link rel="icon" href="data:," /> | |
<title>Copy to Clipboard</title> | |
</head> | |
<body> |
from flask import Flask, session, escape, request, redirect, url_for | |
from os import urandom | |
app = Flask(__name__) | |
app.debug = True | |
app.secret_key = urandom(24) | |
@app.route('/') |
<style> | |
input[type='radio'] { | |
accent-color: #232323; | |
} | |
</style> |
<!-- HTML --> | |
<details open id="details_vermelho" class="collapse1"> | |
<summary class="title">Vermelho</summary> | |
<div style="background-color: #e14747"><br></div> | |
<div> | |
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit.</p> | |
</div> | |
</details> | |
# Traditional approach | |
squares = [] | |
for num in range(1, 11): | |
squares.append(num**2) | |
# List comprehension | |
squares = [num**2 for num in range(1, 11)] |
# Traditional approach | |
point = (3, 7) | |
x = point[0] | |
y = point[1] | |
# Tuple unpacking | |
x, y = point | |
# Pro Tip: When unpacking tuples, you can use an asterisk (*) to capture multiple elements into a single variable. | |
# This is particularly useful when dealing with variable-length tuples. |
# Traditional approach | |
file = open("data.txt", "r") | |
try: | |
data = file.read() | |
# Process the data | |
finally: | |
file.close() | |
# Context manager | |
with open("data.txt", "r") as file: |
import sqlite3 | |
with sqlite3.connect("mydb.db") as conn: | |
cursor = conn.cursor() | |
cursor.execute("SELECT * FROM users") | |
results = cursor.fetchall() |