Jun 22, 2024
import tkinter as tk
root = tk.Tk()
button = tk.Button(root, text='Click Me')
button.pack()
root.mainloop()
frame = tk.Frame(root)
frame.pack()
widget.grid(row=0, column=0)
button = tk.Button(root, text='Click Me', command=my_function)
button = tk.Button(root, text='Click Me', command=lambda: my_function(arg))
entry = tk.Entry(root)
entry.grid(row=0, column=0)
label = tk.Label(root, text='Name')
label.grid(row=0, column=1)
def submit():
name = entry.get()
print(name)
import sqlite3
conn = sqlite3.connect('database.db')
cursor = conn.cursor()
cursor.execute("CREATE TABLE...?")
conn.commit()
cursor.execute("INSERT INTO...?")
conn.commit()
cursor.execute("SELECT ...?")
records = cursor.fetchall()
import requests
response = requests.get(api_url)
import json
data = json.loads(response.content)
airnowapi.orgtry:
api_response = requests.get(api_url).json()
except Exception as e:
print('Error:', e)
numpy, matplotlib
import numpy as np
import matplotlib.pyplot as plt
data = np.random.normal(200000, 25000, 5000)
plt.hist(data, bins=50)
plt.show()