Skip to content

Instantly share code, notes, and snippets.

@deajan

deajan/tk-test.py

Created Dec 13, 2018
Embed
What would you like to do?
tk test for nuitka
from __future__ import print_function
if str is bytes:
try:
import Tkinter as tk
except:
print("Cannot import Tkinter")
exit(1)
else:
try:
import tkinter as tk
except:
print("Cannot impoer tkinter")
exit(2)
try:
root = tk.Tk()
max_width = root.winfo_screenwidth() - 20
max_height = root.winfo_screenheight() - 135
max_size = (max_width, max_height)
root.destroy()
print("successful tkinter invocation")
print("screen size:", max_size)
except:
print("Cannot create tk window")
exit(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.