bestSMS/best/clear_inbox.py
2011-10-15 14:04:38 -04:00

15 lines
303 B
Python
Executable File

import pygsm
modem = pygsm.GsmModem("/dev/ttyS0", baudrate=115200, timeout=1)
modem.boot()
for i in range(25):
try:
temp = modem.command('AT+CMGR=' + str(i+1)+',1')
if "REC READ" in temp[0]:
modem.query('AT+CMGD=' + str(i+1))
except:
pass