-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscattexp.py
34 lines (28 loc) · 930 Bytes
/
scattexp.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
33
34
import sys
import comtypes.client
def print_use():
print("Usage: scattexp <filename.scatt>")
def main(filename):
print("Loading file " + filename)
try:
scattdoc = comtypes.client.CreateObject("ScattDoc.ScattDocument")
except OSError:
print("Cannot find Scatt Professional, please check it is installed")
return 1
scattdoc.FileName = filename
try:
scattdoc.Load()
except comtypes.COMError:
print("Problem loading file")
return 1
print(scattdoc.ShooterName)
return 0
if __name__ == '__main__':
# Scatt Professional is only 32-bit and so only can be accessed from a 32-bit process.
if sys.platform != "win32" or sys.maxsize > 2 ** 32:
print("This application needs to be run with a 32-bit python on Windows")
sys.exit(1)
if len(sys.argv) < 2:
print_use()
sys.exit(1)
sys.exit(main(sys.argv[1]))