Hi
i'm on IT at a small firm and need to automate a process...i've been learning python for some time now and would need help on the ffg problem:
the program needs to communicate with a modem over the serial port,sending commands like "read message" and other AT commands ""at specific time intervals of the day"" and continue to listen in on the modem for any incoming message. the message recieved is then stored in a text file on my computer.
so far i've comeup with a script similar to this::
CODE
import serial
from time import *
def conSerial(port=1): #this selects the COM port #andcontrols data over serial
def ...e.t.c
the main problems i'm having now are:
how do i keep the program running without using a while loop as i realise doing something like
CODE
def wait(s=0):
endtime=time()+s
while (endtime>time()):
pass
...will make my system stuck for the time specified
Also, is there no way to use an instance of 'serial.Serial' defined in function 1,in function 2 without declaring it 'global'?
In general,i think i'm still a newbie...Help will be appreciated