Even though Tkinter is a cross-platform module, you might come across occasions when code written for one operating system might not work as expected on other operating systems. We already saw one such example in the case of getting command-line results in the previous Redirecting the command-line output to Tkinter. In such cases, you can overcome these cross-platform discrepancies by first identifying the operating system on which the program is being run and then using a conditional statement to run different lines of code for different operating systems.
Here's a brief snippet that demonstrates this concept:
from platform import uname
operating_system = uname()[0]
if ( operating_system == "Linux" ):
canvas.bind('<Button-4>', wheelUp) # X11
canvas.bind('<Button-5>', wheelDown)
elif ( operating_system...