import random import os from tkinter import * from time import sleep # Erstellung eines Fensters fenster = Tk() fenster.title('Russisch Roulette 2.0') fenster.geometry('330x200') fenster.resizable(0,0) #Liste generieren a=list(range(0,6)) for i in range(0,6): a[i]=0 a[random.randint(0,5)]=1 j=0 #Funktionen def button_click(): output=shutdown() labeloutput.config(text=str(output)) global j j+=1 def shutdown(): global output if a[j]==1: output=str('*PENG*') os.system('shutdown -l -t3') else: output=str('*Klick*') return output #Labels labelfile=Label(text='Filename:') labelfile.place(x=10,y=10) entryfile=Entry() entryfile.place(x=90,y=10,width=200,height=20) labelloc=Label(text='File Location:') labelloc.place(x=10,y=40) entryloc=Entry() entryloc.place(x=90,y=40,width=200,height=20) buttonplay=Button(text='Play',command=button_click) buttonplay.place(x=40,y=80,width=250,height=30) labeloutput=Label() labeloutput.place(x=130,y=150)