1import os 2import sys 3 4_netgen_bin_dir=os.path.realpath(os.path.join(os.path.dirname(__file__),'..','@NETGEN_PYTHON_RPATH_BIN@')) 5_netgen_lib_dir=os.path.realpath(os.path.join(os.path.dirname(__file__),'..','@NETGEN_PYTHON_RPATH@')) 6 7if sys.platform.startswith('win'): 8 if sys.version >= '3.8': 9 os.add_dll_directory(_netgen_bin_dir) 10 else: 11 os.environ['PATH'] += ';'+_netgen_bin_dir 12 13del sys 14del os 15 16from . import libngpy 17 18def Redraw(*args, **kwargs): 19 try: 20 if libngpy.meshvis._Redraw(*args, **kwargs): 21 import netgen 22 import tkinter 23 cnt = 0 24 while(netgen.gui.win.tk.dooneevent(tkinter._tkinter.DONT_WAIT) and cnt < 100): 25 cnt += 1 26 except: 27 pass 28 29 30