This PR updates the way tkinter and related modules are imported to avoid crashing unexpectedly if tkinter is missing.
Changes Made
Reorganized tkinter imports for improved readability.
Added error handling for ImportError when tkinter module is not found.
Reason for the Changes
The added error handling provides a more user-friendly error message if the tkinter module is missing.
On many linux distros tkinter must be manually installed and on Windows it can be skipped with a custom install.
Testing
I've tested this code on my local environment to ensure that the new imports work as expected and that the error handling is triggered when needed.
Checklist
[x] Code compiles and runs without errors
[x] Existing functionality is not affected by the changes
Description
This PR updates the way
tkinter
and related modules are imported to avoid crashing unexpectedly iftkinter
is missing.Changes Made
tkinter
imports for improved readability.ImportError
whentkinter
module is not found.Reason for the Changes
The added error handling provides a more user-friendly error message if the
tkinter
module is missing. On many linux distrostkinter
must be manually installed and on Windows it can be skipped with a custom install.Testing
I've tested this code on my local environment to ensure that the new imports work as expected and that the error handling is triggered when needed.
Checklist
Please review and merge this PR. Thank you!