def Kuvaus(db): try: location = oma_funktiot.room_desc(db) desc = oma_funktiot.location(location) syote2.configure(text=str(desc)) return desc # Entry.insert(syote2, desc) except ValueError: virhe = "Et antanut pelkkiä lukuja!" return virhe
sys.stdout.flush() time.sleep(.04) time.sleep(2) input("\nPRESS ENTER TO START") cursor=db.cursor() cursor.execute("select * from plot") plot = cursor.fetchone() show_room_desc = 1 #pelin päälooppi while plot !=(1, 1, 1, 1, 0) and plot !=(1, 1, 1, 1, 1): if show_room_desc == 1: location = oma_funktiot.room_desc(db) print(oma_funktiot.location(location)) show_room_desc = 0 print(oma_funktiot.people(db)) first_input=input("\nWhat do you want to do?\n") if first_input != "quit": player_input(first_input) else: cursor.execute("update plot set state1=1,state2=1,state3=1,state4=1,state5=1") print("Thanks for playing Mystery Mansion!") cursor.execute("select * from plot") plot=cursor.fetchone() if plot == (1, 1, 1, 0, 0): cursor.execute("update npc set trust=2 where npcID=2")
kertonappi.pack(side=RIGHT) lopetusnappi = Button(frame4, text="Quit", command=quit_program) lopetusnappi.pack(side=BOTTOM) # Kuva back_image = PhotoImage(file="mansionBG_vaalea.gif", height=300, width=800) # tulostetaan syotteet syote2 = Label( frame1, justify=LEFT, compound=CENTER, padx=10, text=oma_funktiot.location("guestroom"), image=back_image, fg="white", font=("Courier", 9), ) syote2.pack(side=TOP) Printframe = Scrollbar(frame4) Printframe.pack(side=RIGHT, fill=Y) Infotext = Text(frame2, height=10, width=100, bg="black", fg="white") Infotext.pack(side=TOP, fill=Y) Printframe.config(command=Infotext.yview) Infotext.config(yscrollcommand=Printframe.set)
frame4=Frame(GUI) frame4.pack() #tehdään napit komennoille ja lopetukselle execute=Button(frame3, text="execute", command=execute_prints) execute.pack(side=RIGHT) lopetusnappi=Button(frame4, text="Quit", command=lopeta) lopetusnappi.pack(side=BOTTOM) #tulostetaan syotteet syote2=Label(frame1, padx=10, text=oma_funktiot.location("guestroom")) syote2.pack(side=TOP) S = Scrollbar(frame2) T = Text(frame2, height=4, width=50) S.pack(side=RIGHT, fill=Y) T.pack(side=LEFT, fill=Y) S.config(command=T.yview) T.config(yscrollcommand=S.set) kuvaus = oma_funktiot.location("guestroom") quote = kuvaus T.insert(END, quote)