Pita
Pita

Reputation: 41

Room reservation program in Python EasyGUI. How to display chosen data in a message box & saving chosen data in a txt file?

I am working on a conference room reservation application and I need some help with it. I am a complete beginner.

What I have till now:

https://hastebin.com/irejasiyeh.lua

What I want to code:

When you select the time in the last step, a message box should open with a confirmation of the selected room, day and time.

I have figured out how to open a message box after you select the time but I cant figure out how to display all the chosen data from the previous steps.

When you click the OK button it should save the data (room, day and time) in a txt file.

I have figured out you need to do it with:

with open("1.txt", "w") as f:
     print("Vergaderruimte:", rooms1, file=f)
     print("Dag", days1, file=f)
     print("Tijd", times1, file=f)

But now it saves everything from each list. What am I doing wrong?

(Someone who helped me with it said I need to add variables to store the reservations.

Like that: reserved_rooms = { 'res_id': 0, 'reservations': {'room': 3, 'time': '09:00 - 10:00', 'day': 1}}

Then if a reservation happens, you add an item into the reserved_rooms dict, incrementing res_id.

But I have no idea what I have to do with this.)

I need some help with this.

Upvotes: 0

Views: 175

Answers (0)

Related Questions