本文整理匯總了Python中Command.Command.getValue方法的典型用法代碼示例。如果您正苦於以下問題:Python Command.getValue方法的具體用法?Python Command.getValue怎麽用?Python Command.getValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Command.Command
的用法示例。
在下文中一共展示了Command.getValue方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: sendCommand
# 需要導入模塊: from Command import Command [as 別名]
# 或者: from Command.Command import getValue [as 別名]
def sendCommand(f):
print '--------- Datalogger Simulator -----------'
while len(sensorReceiver) > 0:
print 'Ingrese uno de los siguientes comandos:'
for key,val in sorted(command.items()):
print " "*5,key, ":", val
commandInput = raw_input('>>')
if command.has_key(commandInput):
print 'Ingrese un sensor destinatario'
for key,val in sorted(sensorReceiver.items()):
print " "*5,key, ":", val
sensorInput = raw_input('>>')
if sensorReceiver.has_key(sensorInput):
if commandInput == '1':
frequency = 0
elif commandInput == '2':
print 'Ingrese una valor de frecuencia'
frequency = raw_input('>>')
else:
frequency = 0
comando = Command(sensorReceiver[sensorInput],'client03' , 5, 100, ' ',command[commandInput], frequency)
com.send(comando)
f.write(comando.getReceiver().center(15)+ comando.getCommand().center(10) +str(comando.getValue()).center(10)
+'-'.center(10)+'-'.center(10)+ time.strftime("%H:%M:%S").center(10)+'\n')
if commandInput == '3':
del sensorReceiver[sensorInput];
else:
print 'el sensor no existe\n'
else:
print 'comando erroneo\n'
exit(0)