Пример #1
0
from tkinter import *
from tkinter import messagebox
# Tkinter GUI creating library
from PIL import ImageTk, Image
# from photo image library import Tkinter image and image manipulation
from pygame import mixer
# Import pygame mixer library to play audio
import json
# library to decode json into python dictionary
from random import randint, shuffle
# Library to produce random integers and shuffle lists
# Library to create system dialogs

root = Tk()
# Set root to main tkinter window
root.minsize(width=666, height=666)
# Specify minimum size for root window
root.title("Revision")
# Set the title at top of the window

sound = True
# Variable to allow the user to disable sound


def get_questions(json_file):
    file_open = open(json_file)
    # Opens specified JSON file for reading
    json_raw = file_open.read()
    # Reads JSON file as a string
    json_data = json.loads(json_raw)
    # Decodes JSON data as a python dictionary from a string
Пример #2
0
from tkinter import *

t = Tk()
import math
import locale
import tkinter as Tk

t.minsize(850, 600)

def login():
    f4= Frame(bg="black")
    f4.place(x=70, y=0, width=600, height=600)
    f3 = Frame(bg="pink")
    f3.place(x=100, y=0, width=750, height=600)
    u = Label(f3, text="LOGIN", bg="sky blue", fg="black")
    u.place(x=350, y=30)
    u1 = Label(f3, text="User Name", bg="black", fg="white")
    u1.place(x=250, y=90)

    e1 = Entry(f3, font=("", 12))
    e1.place(x=350, y=90, width=120)

    u2 = Label(f3, text="Password", bg="black", fg="white")
    u2.place(x=250, y=130)

    e1 = Entry(f3, font=("", 12),show="*")
    e1.place(x=350, y=130, width=120)

    
    b3 = Button(f3, text="Login", command=calculator)
    b3.place(x=310, y=190, width=100, height=40)