Skip to content

Instantly share code, notes, and snippets.

import pandas as pd
from string import ascii_uppercase as alphabet
all_tables = pd.read_html("https://en.wikipedia.org/wiki/2022_FIFA_World_Cup")
dict_tables = {}
for letter, i in zip(alphabet, range(11, 67, 7)):
df = all_tables[i]
df.rename(columns={df.columns[1]: 'Team'}, inplace=True)
df.pop('Qualification')
import sqlite3
# create a connection
conn = sqlite3.connect('students.db')
c = conn.cursor() # cursor
# create a table
c.execute("""CREATE TABLE students (
name TEXT,
import sqlite3
# create a connection
conn = sqlite3.connect('students.db')
# create a table
c = conn.cursor() # cursor
c.execute("""CREATE TABLE students (
name TEXT,
def hello_world(year):
print(f"Hello World {year}")
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import pandas as pd
# Connect to Google Sheets
scope = ['https://www.googleapis.com/auth/spreadsheets',
"https://www.googleapis.com/auth/drive"]
credentials = ServiceAccountCredentials.from_json_keyfile_name("gs_credentials.json", scope)
client = gspread.authorize(credentials)
from decouple import config
username = config('username', default='')
password = config('password', default='')
print(username, password)
username = "python-lover"
password = "zenofpython123"
send_image_button = driver.find_element(by='xpath', value='//div[@data-testid="drawer-middle"]//span[@data-testid="send"]')
send_image_button.click()
time.sleep(5) # wait till the message is delivered
driver.quit()
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
</head>