3

I am trying to create a GUI in Python using PySimpleGUI to log my work hours. I am writing the data to an Excel file. So far, everything is working the way it should.

What I can't figure out is how to create a time input field. I thought something similar to how the CalendarButton works would be possible, only that one is prompted with a field to select the time, not a date. Is this possible?

Another thing that came to my mind was a field with those up and down arrows on the side. I have no idea what they are called, so I was not even able to find out, if and how they are available within PySimpleGUI. So, what are they called?

What I am trying to avoid is to have to manually type the colon (:) between the digits. I guess an alternative would be to format an input like 730 to 07:30 ....

I tried many different search terms searching the PySimpleGUI.py, in google, and on this site to no avail. I know one can format the output of the CalenderButton, but I don't know how this would help me, as I need to be able to insert a time directly.

tiuq23
  • 113
  • 2
  • 11
  • You don't need Google in order to find out what a Spin element is, you need to check the PySimpleGUI documentation which you'll find here: http://www.PySimpleGUI.org. The Demo Programs will be helpful too. http://Demos.PySimpleGUI.org. Do just a few minutes of studying and you'll be able to solve this one easy enough. – Mike from PSG Nov 26 '20 at 18:44
  • Thank you. I actually just found out that it is called that while searching for something else ... . Now I just need to format the input as `'%H:%M'` and increment them accordingly. – tiuq23 Nov 27 '20 at 10:47

0 Answers0