From 38b570e1fcb52f945765c495590345500c3bb60b Mon Sep 17 00:00:00 2001 From: drunsinn Date: Mon, 14 Dec 2020 17:40:26 +0100 Subject: [PATCH] make tkinter import optional only import tkinter library if it is needed --- type2nc/type2nc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/type2nc/type2nc.py b/type2nc/type2nc.py index 348d0e1..0ed6256 100644 --- a/type2nc/type2nc.py +++ b/type2nc/type2nc.py @@ -8,10 +8,6 @@ import platform import datetime import string -import tkinter as tk -import tkinter.filedialog as tkfd -import tkinter.simpledialog as tksd -import tkinter.messagebox as tkmb import argparse import numpy as np from scipy.special import binom @@ -437,6 +433,10 @@ def generate_demo_file(self, use_cycle_def=False): file_types = [('Font', '*.ttf *.tte *.ttc *.otf *.dfont *.pfb')] if args.input is None: + import tkinter as tk + import tkinter.filedialog as tkfd + import tkinter.simpledialog as tksd + import tkinter.messagebox as tkmb root = tk.Tk() root.overrideredirect(1) root.withdraw()