Jovian
⭐️
Sign In
In [3]:
import tkinter as tk
from tkinter import *
from tkinter import ttk
import sqlite3
m=Tk()
db = sqlite3.connect("Gym.db")
cur=db.cursor()
cur.execute("SELECT * from Squat")
label1=Label(m,text="date")
for row in cur:
    Libcontect_label = tk.Label(m, text= row  ,font="LARGE_FONT")
    Libcontect_label.pack(pady=10,padx=10)
m.mainloop()
In [97]:
import tkinter as tk
from tkinter import *
from tkinter import ttk
import sqlite3
m=Tk()
db = sqlite3.connect("Gym.db")
cur=db.cursor()
cur.execute("SELECT * from Squat")
tree=ttk.Treeview(m)
tree["columns"]=("one","two","three")
tree.column("#0", width=270, minwidth=270, stretch=tk.NO)
tree.column("one", width=150, minwidth=150, stretch=tk.NO)
tree.column("two", width=400, minwidth=200)
tree.column("three", width=80, minwidth=50, stretch=tk.NO)
tree.heading("#0",text="Name",anchor=tk.W)
tree.heading("one", text="Date",anchor=tk.W)
tree.heading("two", text="weight",anchor=tk.W)
tree.heading("three", text="reps",anchor=tk.W)
tree.pack(side=tk.TOP,fill=tk.X)
label1=Label(m,text="date")

# # Level 1
# folder1=tree.insert("", 1, text="GYM ", values=("","",""))
# tree.insert("", 1, text="text_file.txt", values=("23-Jun-17 11:25","TXT file","1 KB"))
# # Level 2
# tree.insert(folder1, "end",  text="photo1.png", values=("23-Jun-17 11:28","PNG file","2.6 KB"))
# tree.insert(folder1, "end", text="photo2.png", values=("23-Jun-17 11:29","PNG file","3.2 KB"))
# tree.insert(folder1, "end",  text="photo3.png", values=("23-Jun-17 11:30","PNG file","3.1 KB"))
id=1
for row in cur:
    tree.insert("", 1, text=id, values=row)
    id=id+1
    
#     Libcontect_label = tk.Label(m, text= row  ,font="LARGE_FONT")
#     Libcontect_label.pack(pady=10,padx=10)

m.mainloop()
In [84]:
import tkinter as tk

root = tk.Tk()

v = tk.IntVar()
v.set(1)  # initializing the choice, i.e. Python

languages = [
    ("Python",1),
    ("Perl",2),
    ("Java",3),
    ("C++",4),
    ("C",5)
]

def ShowChoice():
    print(v.get())

tk.Label(root, 
         text="""Choose your favourite 
programming language:""",
         justify = tk.LEFT,
         padx = 20).pack()

for val, language in enumerate(languages):
    tk.Radiobutton(root, 
                  text=language,
                  padx = 20, 
                  variable=v, 
                  command=ShowChoice,
                  value=val).pack(anchor=tk.W)


root.mainloop()
0
In [98]:
import jovian

In [ ]:
jovian.commit()
[jovian] Saving notebook..
In [ ]: