Не работает код дальше после одной строки. Python
from tkinter import *
from tkinter import filedialog, messagebox
from tkinter.ttk import Combobox
from pygame import *
import pyautogui as p
f = open("script1open.fridsys", mode="r+")
f1 = f.read()
if f1 == "open(2ir9dls02ls5jd0sl3j2)cotur2-dk93k":
start = Tk()
start.title("Start Open FRID Redactor")
start.geometry('400x250')
combo = Combobox(start)
combo['values'] = ("English", "Русский")
combo.current(0) # установите вариант по умолчанию
lbl12 = Label(start, text="Pick your language", font=("Helvetica", 14))
lbl12.pack(fill='x')
combo.pack(fill='x')
def kurla():
fd1 = open("pilang.fridsys", mode='w+')
fd12 = fd1.write(combo.get())
button = Button(start, text="Pick", command=kurla)
button.pack(fill='x')
start.mainloop()
df = open("pilang.fridsys", mode='w+')
language = df.read()
if language == 'English':
def Quit():
global root
core122 = messagebox.askyesno("Saving the file", "Save your unfinished file?")
if core122 == True:
SaveFile()
elif core122 == False:
root.destroy()
elif core122 == None:
root.destroy()
print(core122)
def LoadFile():
fn = filedialog.Open(root, filetypes=[('*.all files', '.*')]).show()
if fn == '':
return
textbox.delete('1.0', 'end')
textbox.insert('1.0', open(fn, 'rt').read())
def SaveFile():
fn = filedialog.SaveAs(root, filetypes=[('*.all files', '.*')]).show()
if fn == '':
return
messagebox.showinfo('File Extension Error (021)', 'You must specify a file extension at the end!')
open(fn, 'wt').write(textbox.get('1.0', 'end'))
def clsi():
root = Tk()
root.title("FRID Redactor")
root.geometry('500x25')
lbl = Label(root, text="Fander Company. 2022 - TestProduct", font=("Helvetica", 14))
lbl.pack(fill = 'both')
def clsi1():
import webbrowser
webbrowser.open('https://www.fadcomp.tk', new=0)
root = Tk()
root.title("FRID Redactor")
root["bg"] = "cyan"
menu = Menu(root)
new_item1 = Menu(menu)
new_item2 = Menu(menu)
new_item3 = Menu(menu)
new_item1.add_command(label='About', command=clsi)
new_item1.add_command(label='Site', command=clsi1)
new_item2.add_command(label='Load', command=LoadFile)
new_item2.add_command(label='Save', command=SaveFile)
new_item2.add_command(label='Quit', command=Quit)
menu.add_cascade(label='Info', menu=new_item1)
menu.add_cascade(label='File', menu=new_item2)
root.config(menu=menu)
panelFrame = Frame(root, height=30, bg='cyan')
panelFrame2 = Frame(root, height=30, bg='cyan')
textFrame = Frame(root, height=340, width=600)
panelFrame.pack(side='top', fill='x')
panelFrame2.pack(side='bottom', fill='x')
textFrame.pack(side='bottom', fill='both', expand=1)
textbox = Text(textFrame, font='Helvetica 18', wrap='word')
scrollbar = Scrollbar(textFrame)
scrollbar['command'] = textbox.yview
textbox['yscrollcommand'] = scrollbar.set
lbl1 = Label(panelFrame2, text='Version 1.0.0')
lbl1.pack(side = 'right')
lbl1['bg'] = "cyan"
lbl1['fg'] = "white"
textbox.pack(side='left', fill='both', expand=1)
scrollbar.pack(side='right', fill='y')
root.mainloop()
elif language == "Русский":
def Quit():
global root
core122 = messagebox.askyesno("Сохранение файла", "Сохранить ваш незавершенный файл?")
if core122 == True:
SaveFile()
elif core122 == False:
root.destroy()
elif core122 == None:
root.destroy()
print(core122)
def LoadFile():
fn = filedialog.Open(root, filetypes=[('*.all files', '.*')]).show()
if fn == '':
return
textbox.delete('1.0', 'end')
textbox.insert('1.0', open(fn, 'rt').read())
def SaveFile():
fn = filedialog.SaveAs(root, filetypes=[('*.all files', '.*')]).show()
if fn == '':
return
messagebox.showinfo('Ошибка расширения файла (021)', 'Вы должны указать расширение файла!')
open(fn, 'wt').write(textbox.get('1.0', 'end'))
def clsi():
root = Tk()
root.title("FRID Редактор")
root.geometry('500x25')
lbl = Label(root, text="Fander Company. 2022 - Тестовый продукт", font=("Helvetica", 14))
lbl.pack(fill = 'both')
def clsi1():
import webbrowser
webbrowser.open('https://www.fadcomp.tk', new=0)
root = Tk()
root.title("FRID Редактор")
root["bg"] = "cyan"
menu = Menu(root)
new_item1 = Menu(menu)
new_item2 = Menu(menu)
new_item3 = Menu(menu)
new_item1.add_command(label='About', command=clsi)
new_item1.add_command(label='Site', command=clsi1)
new_item2.add_command(label='Load', command=LoadFile)
new_item2.add_command(label='Save', command=SaveFile)
new_item2.add_command(label='Quit', command=Quit)
menu.add_cascade(label='Info', menu=new_item1)
menu.add_cascade(label='File', menu=new_item2)
root.config(menu=menu)
panelFrame = Frame(root, height=30, bg='cyan')
panelFrame2 = Frame(root, height=30, bg='cyan')
textFrame = Frame(root, height=340, width=600)
panelFrame.pack(side='top', fill='x')
panelFrame2.pack(side='bottom', fill='x')
textFrame.pack(side='bottom', fill='both', expand=1)
textbox = Text(textFrame, font='Helvetica 18', wrap='word')
scrollbar = Scrollbar(textFrame)
scrollbar['command'] = textbox.yview
textbox['yscrollcommand'] = scrollbar.set
lbl1 = Label(panelFrame2, text='Version 1.0.0')
lbl1.pack(side = 'right')
lbl1['bg'] = "cyan"
lbl1['fg'] = "white"
textbox.pack(side='left', fill='both', expand=1)
scrollbar.pack(side='right', fill='y')
root.mainloop()
Сначала у меня идет окно с выбором языка, после он должен перейти на root окно, но он ничего не делает. Как справиться?