开发者

Python USSD via com port

开发者 https://www.devze.com 2023-01-16 16:10 出处:网络
I am new to python. Is there anyway i can use python to send ussd with a phone via at+cusd commands. i can do that using hypertermina开发者_StackOverflow中文版l. i want to automate using python. thank

I am new to python. Is there anyway i can use python to send ussd with a phone via at+cusd commands. i can do that using hypertermina开发者_StackOverflow中文版l. i want to automate using python. thanks.


Yes. Use pyserial.

>>> import serial
>>> ser = serial.Serial(0)  # open first serial port
>>> print ser.portstr       # check which port was really used
>>> ser.write("hello")      # write a string
>>> ser.close()             # close port
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号