netgen/python/__main__.py

26 lines
586 B
Python
Raw Normal View History

2021-10-27 19:50:07 +05:00
import imp, threading
def handle_arguments():
import sys, __main__
argv = sys.argv
if len(argv)>1 and argv[1].endswith(".py"):
with open(argv[1]) as pyfile:
imp.load_module('__main__', pyfile, argv[1], (".py", "r", imp.PY_SOURCE))
def main():
import netgen
# Use Redraw without event handling
netgen.Redraw = netgen._Redraw
try:
import ngsolve
except:
pass
2021-10-27 19:50:07 +05:00
from .gui import win
th = threading.Thread(target=handle_arguments)
th.start()
win.tk.mainloop()
if __name__ == "__main__":
sys.exit(main())