Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
phone:gammu_send_sms [2011/05/27 10:54]
flozz
phone:gammu_send_sms [2011/06/07 09:56]
flozz [Send SMS using Python]
Line 15: Line 15:
 FIXME FIXME
  
 +<code bash>​echo "Hello world from my PC" | gammu sendsms TEXT <​PhoneNumber></​code>​
  
 ===== Send SMS using Python ===== ===== Send SMS using Python =====
Line 20: Line 21:
 FIXME FIXME
  
 +<code python sendsms.py>​
 +#​!/​usr/​bin/​python
 +# -*- coding: UTF-8 -*-
  
 +
 +import gammu
 +
 +
 +gamu_sm = gammu.StateMachine()
 +gamu_sm.ReadConfig() ​             #Read the default config file (~/​.gammurc)
 +gamu_sm.Init() ​                   #Connect to the phone
 +
 +gamu_sm.SendSMS({ ​                #Send the SMS
 +        '​Class':​ 1,
 +        '​Text':​ "Hello World from my Python script :)",
 +        '​SMSC':​ {'​Location':​ 1},
 +        '​Number':​ "​+336xxxxxxxx",​
 +        })
 +
 +</​code>​
 ===== EXAMPLE: A simple Python application with a GTK2 GUI ===== ===== EXAMPLE: A simple Python application with a GTK2 GUI =====
  
 FIXME FIXME
  
 
phone/gammu_send_sms.txt · Last modified: 2017/09/01 12:24 (external edit)