-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathtemplate.py
32 lines (24 loc) · 943 Bytes
/
template.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
config='''import os, sys, re, clr
try:
dll_dir='C:/Program Files/AnsysEM/AnsysEM19.3/Win64/common/IronPython/DLLs'
if not os.path.isdir(dll_dir):
raise Exception
except:
m=re.search('(.*Win64)', __file__)
dll_dir=m.group(1)+'/common/IronPython/DLLs'
finally:
sys.path.append(dll_dir)
clr.AddReference('IronPython.Wpf')
import wpf
from System.Windows import Window
from System.Windows.Controls import ListBoxItem
os.chdir(os.path.dirname(__file__))
'''
exec(config)
#Functions---------------------------------------------------------------------|
#GUI---------------------------------------------------------------------------|
class MyWindow(Window):
def __init__(self):
wpf.LoadComponent(self, 'template.xaml')
#Code End----------------------------------------------------------------------|
MyWindow().ShowDialog()