raspberrypi / pico-project-generator

Tool to automatically generate a Pico C SDK Project
BSD 3-Clause "New" or "Revised" License
297 stars 75 forks source link

Expect tkinter import error - custom error message #97

Closed paulober closed 1 year ago

paulober commented 1 year ago

Description

This PR updates the way tkinter and related modules are imported to avoid crashing unexpectedly if tkinter is missing.

Changes Made

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

Please review and merge this PR. Thank you!