forked from teuben/agui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample4.py
executable file
·30 lines (26 loc) · 913 Bytes
/
example4.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
#! /usr/bin/env python
#
# new 2023 style python
import sys
file1 = "foo" # help for input file1 #> IFILE
file2 = "bar" # help for output file2 #> OFILE
dir3 = "fum" # help for input dir3 #> IDIR
dir4 = "baz" # help for output dir4 #> ODIR
hello = "world" # help for text entry hello #> ENTRY
a = "1" # help for a, between 0 and 2 #> SCALE 0:2:0.1
b = "2" # help for b, pick 1, 2 or 3 #> RADIO 0,1,2
c = "3,c" # help for c, check any of 6 #> CHECK 0,1,2,a,b,c
# parse the key=val command line
for _arg in sys.argv[1:]:
ie = _arg.find('=')
cmd = '%s="%s"' % (_arg[:ie],_arg[ie+1:])
exec(cmd)
# print keyword vaues
print('file1',file1)
print('file2',file2)
print('dir3', dir3)
print('dir4', dir4)
print('hello',hello)
print('a', a)
print('b', b)
print('c', c)