Menu

[6bb4c7]: / gvxrGUI / gvxrGUI.py  Maximize  Restore  History

Download this file

62 lines (40 with data), 1.5 kB

 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env python3
# These two packages are used to know if we are running the program from a MacOSX bundle
import sys, os
# These two packages are used for debugging purposes (catching exceptions)
import traceback, logging
# Matplotlib is used to display the 2D images an the histogram
import matplotlib
# wxPython is used to create the GUI
import wx
# gVirtualXRay's wrapper
from gvxrPython3 import gvxr;
# The main GUI application
import wxApp;
# import slider_code as SC;
from wxCanvasPanel import wxCanvasPanel;
# Initialise the environment
def init():
# Matplotlib relies on the wxPython backend
matplotlib.use('WXAgg')
if getattr(sys, 'frozen', False): # we are running in a bundle
wxApp.g_dir_path = sys._MEIPASS # This is where the files are unpacked to
else: # normal Python environment
wxApp.g_dir_path = os.path.dirname(os.path.abspath(__file__))
# Print the libraries' version
print (gvxr.getVersionOfSimpleGVXR())
print (gvxr.getVersionOfCoreGVXR())
# The main function
if __name__ == '__main__':
try:
# Initialise the environment
init();
# Create the application object
app = wx.App();
gvxrApp = wxApp.wxApp(parent = None, title = "gvxrGUI-0.0.1");
# Launch the event loop
app.MainLoop()
# Catch exceptions if any
except Exception as e:
# Log an error message
logging.error(traceback.format_exc())
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.