Sie sind auf Seite 1von 7

from tkinter import *

import sqlite3 as sql


conn = sql.connect("file1.db")
c = conn.cursor()

name = []
from tkinter import *
import sqlite3
from random import sample
from tkinter import messagebox
import random

l = []

f = []

def clear():
# list = window.grid_slaves()
# for l in list:
window.destroy()

root = Tk()
root.geometry('555x555')
root.title("Registration Form")
root["bg"] = "pink"
Fullname = StringVar()
Email = StringVar()
var = IntVar()
c = StringVar()
var1 = IntVar()

label_0 = Label(root, text=" 'Join Captcha Nation' ", width=20, font=("bold", 20),
bg="pink")
label_0.place(x=90, y=53)

label_1 = Label(root, text="FullName", width=20, font=("bold", 10), bg="pink")


label_1.place(x=80, y=130)

entry_1 = Entry(root, textvar=Fullname)


entry_1.place(x=240, y=130)

label_2 = Label(root, text="Email", width=20, font=("bold", 10), bg="pink")


label_2.place(x=68, y=180)

entry_2 = Entry(root, textvar=Email)


entry_2.place(x=240, y=180)

label_3 = Label(root, text="Gender", width=20, font=("bold", 10), bg="pink")


label_3.place(x=70, y=230)
Radiobutton(root, text="Male", padx=5, variable=var, value=1, bg="pink").place(x=235, y=230)
Radiobutton(root, text="Female", padx=20, variable=var, value=2, bg="pink").place(x=300,
y=230)

label_4 = Label(root, text="country", width=20, font=("bold", 10), bg="pink")


label_4.place(x=70, y=280)

list1 = ['Canada', 'India', 'UK', 'Nepal', 'Iceland', 'South Africa'];

droplist = OptionMenu(root, c, *list1)


droplist.config(width=15)
c.set('select your country')
droplist.place(x=240, y=280)

label_4 = Label(root, text="Programming", width=20, font=("bold", 10), bg="pink")


label_4.place(x=85, y=330)
var2 = IntVar()
Checkbutton(root, text="Java", variable=var1, bg="pink").place(x=235, y=330)

Checkbutton(root, text="Python", variable=var2, bg="pink").place(x=290, y=330)

closeButton = Button(root)
closeButton.configure(text="CLOSE", fg='white', bg='#ff0000')
closeButton.place(x=30, y=580)
# closeButton.grid(row = 5, column = 2, columnspan = 6, pady = 7)
# Generate Numbers
numberGen = Button(root, width=20, text="Generate Captcha", command=response)
numberGen.configure(fg="White", bg="Green")
numberGen.place(x=180, y=380)

# numberGen.grid(row = 1, column = 4, padx = 5, pady = 7)

# defining a function to close the program


def close():
quit()

# attaching the "close" function to the "close" button


closeButton.configure(command=close)
root.mainloop()

def response():

top1 = Tk()
top1.geometry("400x555")
name1 = ['18.png','19.png','20.png']

def gui():

pic = PhotoImage(master=top1,file=name1[0] )
bx = Button(top1, image = pic, height = 97, width = 97)
bx.image = pic
bx.place(x = 0, y = 100)
l.append(1)

def but_sec2():
photo20 = PhotoImage(master=top1, file='19.png')
ba2 = Button(top1,image = photo20 )
ba2.image = photo20
ba2.place(x=103, y=100)
l.append(1)

def but_sec3():
photo32 = PhotoImage(master=top1, file="20.png")
ba3 = Button(top1,image = photo32 )
ba3.image = photo32
ba3.place(x=200, y=100)
l.append(1)
def but_sec4():
photo33 = PhotoImage(master=top1, file='21.png')
ba4 = Button(top1,image = photo33 )
ba4.image = photo33
ba4.place(x=297, y=100)
f.append(1)

def but_sec5():
photo34 = PhotoImage(master=top1, file="34.png")

ba5 = Button(top1,image = photo34 )


ba5.image = photo34
ba5.place(x=0, y=197)

l.append(1)

def but_sec6():
photo35 = PhotoImage(master=top1, file="23.png")
ba6 = Button(top1,image = photo35 )
ba6.image = photo35
ba6.place(x=103, y=197)

l.append(1)
def but_sec7():
photo36 = PhotoImage(master=top1, file="24.png")
ba7 = Button(top1,image = photo36 )
ba7.image = photo36
ba7.place(x=200, y=197)

l.append(1)
def but_sec8():
photo37 = PhotoImage(master=top1,file="25.png")
ba8 = Button(top1,image = photo37 )
ba8.image = photo37
ba8.place(x=297, y=197)
f.append(1)
def but_sec9():
photo38 = PhotoImage(master=top1, file="26.png")
ba9 = Button(top1,image = photo38 )
ba9.image = photo38
ba9.place(x=0, y=294)
l.append(1)
def but_sec10():
photo39 = PhotoImage(master=top1, file="27.png")
ba10 = Button(top1,image = photo39 )
ba10.image = photo39
ba10.place(x=103, y=294)
l.append(1)
def but_sec11():
photo40 = PhotoImage(master=top1, file="28.png")
ba11 = Button(top1,image = photo40 )
ba11.image = photo40
ba11.place(x=200, y=294)
f.append(1)
def but_sec12():
photo41 = PhotoImage(master=top1, file="29.png")
ba12 = Button(top1,image = photo41 )
ba12.image = photo41
ba12.place(x=297, y=294)
f.append(1)
def but_sec13():
photo42 = PhotoImage(master=top1, file="30.png")
ba13 = Button(top1,image = photo42 )
ba13.image = photo42
ba13.place(x=0, y=391)
l.append(1)
def but_sec14():
photo43 = PhotoImage(master=top1, file="31.png")
ba14 = Button(top1,image = photo43 )
ba14.image = photo43
ba14.place(x=103, y=391)
l.append(1)
def but_sec15():
photo44 = PhotoImage(master=top1, file="32.png")
ba15 = Button(top1,image = photo44 )
ba15.image = photo44
ba15.place(x=200, y=391)
f.append(1)

def but_sec16():
photo45 = PhotoImage(master=top1, file="33.png")
ba16 = Button(top1,image = photo45 )
ba16.image = photo45
ba16.place(x=297, y=391)

f.append(1)
rj = c.execute("SELECT ID, NAME, ID2 FROM streat")
for row in rj:
xx = row[1]
name.append(xx)
canvas = Canvas(top1, bd = 5, bg = "pink", height = 100, width = 400)
canvas.place(x = 0, y = 0)

photo1 = PhotoImage(master = top1, file = name[0])


b1 = Button(master = top1, image=photo1, command = gui)
b1.place(x=0, y=100)
photo17 = PhotoImage(master=canvas, file= "/home/rjsng/Desktop/Python_Project/17.png")
label = Label(canvas, text = "Select all boxes\n with street signs:", bg = "pink", fg = "black")
label.place(x = 4, y = 10)
label.config(font=("bold", 20))
label2 = Label(master = canvas, image = photo17)
label2.place(x = 295, y = 5)

photo2 = PhotoImage(master = top1,file=name[1])


b2 = Button(top1, image=photo2, height=97, width=97,command = but_sec2)
b2.place(x=103, y=100)

photo3 = PhotoImage(master = top1,file=name[2])


b3 = Button(top1, image=photo3, height=97, width=97,command = but_sec3)
b3.place(x=200, y=100)

photo4 = PhotoImage(master = top1,file=name[3])


b4 = Button(top1, image=photo4, height=97, width=97,command = but_sec4)
b4.place(x=297, y=100)

photo5 = PhotoImage(master = top1,file=name[4])


b5 = Button(top1, image=photo5, height=97, width=97,command = but_sec5)
b5.place(x=6, y=197)

photo6 = PhotoImage(master = top1,file=name[5])


b6 = Button(top1, image=photo6,command = but_sec6)
b6.place(x=103, y=197)

photo7 = PhotoImage(master = top1,file=name[6])


b7 = Button(top1, image=photo7, height=97, width=97,command = but_sec7)
b7.place(x=200, y=197)

photo8 = PhotoImage(master = top1,file=name[7])


b8 = Button(top1, image=photo8, height=97, width=97,command = but_sec8)
b8.place(x=297, y=197)

photo9 = PhotoImage(master = top1,file=name[8])


b9 = Button(top1, image=photo9, height=97, width=97,command = but_sec9)
b9.place(x=6, y=294)
photo10 = PhotoImage(master = top1,file=name[9])
b10 = Button(top1, image=photo10, height=97, width=97,command = but_sec10)
b10.place(x=103, y=294)

photo11 = PhotoImage(master = top1,file=name[10])


b11 = Button(top1, image=photo11, height=97, width=97,command = but_sec11)
b11.place(x=200, y=294)

photo12 = PhotoImage(master = top1,file=name[11])


b12 = Button(top1, image=photo12, height=97, width=97,command = but_sec12)
b12.place(x=297, y=294)

photo13 = PhotoImage(master = top1,file=name[12])


b13 = Button(top1, image=photo13, height=97, width=97,command = but_sec13)
b13.place(x=6, y=391)

photo14 = PhotoImage(master = top1,file=name[13])


b14 = Button(top1, image=photo14, height=97, width=97,command = but_sec14)
b14.place(x=103, y=391)

photo15 = PhotoImage(master = top1,file=name[14])


b15 = Button(top1, image=photo15, height=97, width=97,command = but_sec15)
b15.place(x=200, y=391)

photo16 = PhotoImage(master = top1,file=name[15])


b16 = Button(top1, image=photo16, height=97, width=97,command = but_sec16)
b16.place(x=297, y=391)

def submit1():
if len(l)==10 and len(f)==0:
messagebox.showwarning(top1, "Congrats...Form Submited...")

quit()
top1.destroy()
else:
messagebox.showwarning(top1, "error")

l.clear()
f.clear()
top1.destroy()

b17 = Button(top1, bg="blue", fg="white", font=("bold", 15), text="Submit",command =


submit1)
b17.place(x=150, y=508)
top1.mainloop()
c.close()

# check = Button(root, width=10, text="check",command=comparing)


# check.configure(fg = "White" ,bg = "Green")
# check.grid(row = 5, column = 3, padx = 5, pady = 7)
# check.place(x=150,y=333)

# Creating a button
# Close

# This is the line that runs the program until you exit
# root.mainloop()

# The results

window = Tk()
window.geometry('666x666')
window.title("Main Page")
window["bg"] = "pink"

labelw = Label(window, text="Welcome to", font=("bold", 15), bg="pink")


labelw.place(x=90, y=191)
labelc = Label(window, text="Captcha Nation", font=("bold", 50), bg="pink")
labelc.place(x=70, y=222)
labelc = Label(window, text="__________________________________", font=("", 22),
bg="pink")
labelc.place(x=79, y=299)
Button(window, text='Start', width=20, bg='brown', fg='white', command=clear).place(x=220,
y=580)

window.mainloop()

Verwandte Interessen