-1
Ich möchte ein Fenster mit "Zeige mich nicht wieder" (ein Toplevel-Fenster). Wenn diese Box überprüft wird, möchte ich nicht, dass sie mir dieses Fenster ein anderes Mal zeigt.Zeige mich nicht wieder Checkbox
import configparser
from tkinter import *
config = configparser.RawConfigParser() #my ini file
config.add_section('Section1')
config.set('Section1', 'a_bool', 'False')
with open('settings.ini', 'w') as configfile:
config.write(configfile)
root = Tk()
def var_states(): #write to ini file
global mt
print(config.read('ayrlar.ini'))
if var1 == True:
config.set('Section1', 'a_bool', 'True')
with open('settings.ini', 'w') as configfile:
config.write(configfile)
global window
window.destroy()
elif var1 == False:
config.set('Section1', 'a_bool', 'False')
with open('settings.ini', 'w') as configfile:
config.write(configfile)
global window
window.destroy()
var1 = config.getboolean('Section1', 'a_bool')
def show(): #if checkbox is true
global window #dont show
window= Toplevel(root)
Checkbutton(window, text="Don't show me again", variable=var1).place(x=0, y=0)
Button(window, text='Okey', command=var_states).place(x=0, y=25)
root.after(10,show)
root.mainloop()
Wenn ein anderes Mal laufen will ich nicht dieses Fenster zeigen. Wie kann ich das mit ConfigParser
tun?
Stack-Überlauf kein Schreiben von Code-Service ist. – ppperry
Sie können meinen Code sehen, ich will nur, was mein Code-Problem ist, warum nicht arbeiten – stackrangerflow