import sys import SER def runCommand arg while try print InputCommand

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
import sys
import SER
def runCommand(arg):
while 1:
try:
print 'InputCommand'
tChar = -1
tStr = ''
while tChar != 13:
tChar = -1
tChar = SER.readbyte()
if tChar not in (13,-1):
tStr = tStr + chr(tChar)
exec(tStr)
except SyntaxError:
print 'syntax error'