hello,
I need to make a compiled script that I know how to do, done more then once, and work, *.pyo.
Then I send it to the gsm module and put it run.
The rest of the code is ok, I have test it more than once but to organize a group of aquired temperatures does not work, next is an example of the code that I need to run:
If I dont declare the variable i I get the error:
Traceback (innermost last):
File "C:\Programas\P ython\Pythonwin \pywin\framewor k\scriptutils.p y", line 301, in RunScript
exec codeObject in __main__.__dict __
File "D:\Python\Scri pt1.py", line 18, in ?
print i
NameError: i
but if I declare i=5 like in the exemple it allway give me an output:
i=5
reset
So what i need is to give a value to i in the beginig and after that first cycle disable it...
Did i make myself clear?
Thanks in advance
Tim
I need to make a compiled script that I know how to do, done more then once, and work, *.pyo.
Then I send it to the gsm module and put it run.
The rest of the code is ok, I have test it more than once but to organize a group of aquired temperatures does not work, next is an example of the code that I need to run:
Code:
import MOD #Use build in module
import MDM #Use AT command interface
#i=5
# wake module
#Set time
#Set next alarm
print i
if i == 1:
i=i+1
print'Temperature=',temp,'ºC'
elif i == 2:
i=i+1
print 'voltage=',volt,'V'
elif i == 3:
i=1
print 'send sms',volt,temp
else:
i = 1
print 'reset'
#Turn off module
Traceback (innermost last):
File "C:\Programas\P ython\Pythonwin \pywin\framewor k\scriptutils.p y", line 301, in RunScript
exec codeObject in __main__.__dict __
File "D:\Python\Scri pt1.py", line 18, in ?
print i
NameError: i
but if I declare i=5 like in the exemple it allway give me an output:
i=5
reset
So what i need is to give a value to i in the beginig and after that first cycle disable it...
Did i make myself clear?
Thanks in advance
Tim
Comment