Ticket #1152: helloworld.py

File helloworld.py, 440 bytes (added by pspierce, 3 months ago)

py file

Line 
1 import os
2 import inspect
3 import dabo
4
5 def main():
6     app = dabo.dApp()
7     curdir = os.getcwd()
8     # Get the current location's path
9     fname = inspect.getfile(main)
10     pth = os.path.split(fname)[0]
11     if pth:
12         # Switch to that path
13         os.chdir(pth)
14     app.MainFormClass = "helloworld.cdxml"
15     print '1'
16     app.start()
17
18     # Return to the original location
19     os.chdir(curdir)
20
21
22 if __name__ == '__main__':
23     main()