Gammu také obsahyje rozhraní pro Python, které vám umožní použít (většinu) funkcí Gammu z programovacího jazyka Python.
python-gammu 3.2.4 has been just released. Maintenance release bringing support for Python 3.10.
Vydal Michal Čihař dne 17. listopadu 2021
python-gammu 3.1 has been just released. Improvements in worker mode.
Vydal Michal Čihař dne 24. července 2020
Python module is now standalone, so please
download it separately. If you want to use binary
package, the daemon might be included in separate binary package in your
distribution, try looking for something like python-gammu
.
Nejjednodušší je instalovat pomocí pip:
pip install python-gammu
Using python-gammu is quite simple, for example sending of the text message can be done by following snippet:
import gammu sm = gammu.StateMachine() sm.ReadConfig() sm.Init() message = { 'Text': 'python-gammu testing message', 'SMSC': {'Location': 1}, 'Number': '+420800123465', } sm.SendSMS(message)
API documentation is available, but you might also find useful libGammu documentation. Please check developer documentation page for more details.
Check also Frequently Asked Questions.
Zdrojový kód i sledování chyb naleznete na GitHubu: