bestSMS/best/clear_inbox.py

15 lines
303 B
Python
Raw Permalink Normal View History

2011-07-16 06:11:20 +00:00
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