import sys
import SER
def runCommand(arg):
while 1:
try:
#stdout from the gsm module is redirected to a serial port, to my console (terminal) in linux
print 'InputCommand'
tChar = -1
tStr = ''
while tChar != 13:
tChar = -1
#reads one byte from the serial port, that is, it reads byte that i type in the terminal
tChar = SER.readbyte()
if tChar not in (13,-1):
tStr = tStr + chr(tChar)
exec(tStr)
except SyntaxError:
print 'syntax error'