-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathundock.py
33 lines (31 loc) · 910 Bytes
/
undock.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
import piInterface as piI
import time
import sys
piI.Connect()
if len(sys.argv) > 1:
if len(sys.argv[1] == 0):
out = piI.Shell('python3 undockpredef.py\n', 0)
print(str(out), end='')
while 'undocked' not in out:
time.sleep(.1)
out = piI.Shell('', 0)
print(out, end='')
else:
out = piI.Shell('python3 undockpredef.py\n', 1)
print(str(out), end='')
while 'undocked' not in out:
time.sleep(.1)
out = piI.Shell('', 1)
print(out, end='')
else:
pi0, pi1 = piI.ShellBoth('python3 undockpredef.py\n')
print(str(pi0) + str(pi1), end='')
while 'undocked' not in pi0:
time.sleep(.1)
pi0 = piI.Shell('', 0)
print(pi0, end='')
while 'undocked' not in pi1:
time.sleep(.1)
pi1 = piI.Shell('', 1)
print(pi1, end='')
piI.Disconnect()