嗨,大家好,我運行下面的python腳本通過libgmail模塊發送短信:誤差libgmail蟒蛇
#!/usr/bin/env python
import libgmail
stuff = libgmail.GmailAccount("[email protected]", "password")
myCellEmail = "[email protected]"
stuff.login()
msg=libgmail.GmailComposedMessage(myCellEmail, "", "Hello World! From python-libgmail!")
stuff.sendMessage(msg)
但是我收到以下錯誤:
Traceback (most recent call last):
File "./sms.py", line 7, in <module>
stuff.login()
File "/usr/local/lib/python2.7/dist-packages/libgmail.py", line 305, in login
pageData = self._retrievePage(req)
File "/usr/local/lib/python2.7/dist-packages/libgmail.py", line 340, in _retrievePage
req = ClientCookie.Request(urlOrRequest)
File "/usr/local/lib/python2.7/dist-packages/mechanize/_request.py", line 31, in __init__
if not _rfc3986.is_clean_uri(url):
File "/usr/local/lib/python2.7/dist-packages/mechanize/_rfc3986.py", line 62, in is_clean_uri
return not bool(BAD_URI_CHARS_RE.search(uri))
TypeError: expected string or buffer
的libgmail模塊已經安裝在我想要的目錄中,所以這不是問題。任何答案將是有益的,謝謝。
這是一個恥辱,我想我將不得不採取另一條路線。 – brucezepplin