arkilis / telstra-sms-sdk

A Python SDK allows you to send sms in a more easy way
MIT License
1 stars 1 forks source link

Broken in Python 3.4 (rasbian latest) #1

Open ryanhunt opened 7 years ago

ryanhunt commented 7 years ago

HI there.

I've got the lastest Rasbian (Debian for Raspberry Pi) build which includes Python 3.4.2. The packages I have install via pip3 are:

When using the sample code I get this error:

Traceback (most recent call last): File "./sendsms.py", line 3, in <module> from telstra_sms_sdk.sms import TelstraSMS File "/usr/local/lib/python3.4/dist-packages/telstra_sms_sdk/sms.py", line 56 print str(e) ^ SyntaxError: invalid syntax

ryanhunt commented 7 years ago

Ok I figured out how to fix it.

Two changes required:

  1. Change all references of print str(e) to print(str(e))
  2. Change all references of json.loads(r.content) to json.loads(r.text)
ryanhunt commented 7 years ago

Ok, I created a fork - fixed the bugs and extended it to support checking the status of sent messages, receiving replies and also checking user quota. I'd advise you review my code and merge with yours.

https://github.com/ryanhunt/telstra-sms-sdk