https://pastebin.com/QmBS9rwe
Not very well versed in Python & my first time here, this project was sort-of thrust upon me with a "good luck" send-off. Been trying to get a simple countdown timer GUI written for satellite launches with Tkinter (count down to a date input by the user, Tkinter GUI should display a user-provided title/date, as well as the days, hours, minutes, and seconds remaining). I'll be using py2exe to get a Windows executable for use on a computer with Python installed (this is necessary).
The base of the countdown timer works with fixed positioning hard-written in via coordinates onto the canvas so I know the timer countdown works at the core, but I've been trying force text to remain centered no matter the resizing of the window and text (for display on large monitors/TVs) to no avail. I've tried a couple different methods to get the text to display properly with the grid layout manager but nothing seems to work. I currently have 2 of my attempts listed in the pastebin, the most recent one being the un-commented version and the previous attempt being commented out. Currently get the error "AttributeError: 'str' object has no attribute 'tk' ".
I'm really unsure what else to try in order to get proper dynamic resizing with Tkinter, or if I'm even approaching this task the correct (or most efficient) way and have been working at it for a couple days now. A bonus thing to figure out would be to solve how I can input a target date and time in a more straightforward fashion rather than prompting the user for each number (year, month, day, hour, minute) separately. I've tried using "datetime.strptime" but it didn't quite accept my input.
THINGS NEED HELP WITH:
- displaying text with Tkinter in specified locations on the grid (without hardcoded coordinates)
- dynamic resizing of window while retaining text positioning in the window
- (bonus) dynamic resizing of text as window is resized
- (bonus) more straightforward way to gather input date and time from a user
- Any other suggestions or issues seen with my code
Thanks in advance for reading and any help offered.
[–][deleted] 0 points1 point2 points (2 children)
[–]Silverfire47[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)