Python Google语音 [英] Python Google Voice

查看:123
本文介绍了Python Google语音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从此处使用google语音API,并尝试发送文本来自Python的消息.但是,每当我尝试使用此代码登录时,都会得到一些我不期望的信息:

I am using the google voice API from here, and trying to send text messages from Python. However, whenever I try to log in using this code, I get something I do not expect:

from googlevoice import tests
from googlevoice import Voice
from googlevoice.util import input

def login():
    username, password = "xyz@gmail.com", "******"
    client = Voice.login(username, password)
    return client

启动此代码的父程序(一个字面上说运行此草图的文件)后,出现以下提示:

Upon starting this code's parent program (a file that literally just says run this sketch), I get this prompt:

Email Address: 

如果我输入电子邮件地址,它将冻结.任何帮助将不胜感激.

If I enter an email address, it just freezes. Any help would be greatly appreciated.

我已经阅读了一些Google语音API支持即将终止/已经终止的地方,并且想知道这是为什么我出错了吗? python兼容吗?我不想付钱从我的计算机发短信!

I've read a few places that the Google Voice API support is coming to an end/has ended and am wondering if this is why I'm getting an error... If so, are there any free alternatives that are python compatible? I don't want to pay to have to text from my computer!

推荐答案

以某种方式,它现在可以正常工作:

Somehow, this has made it work now:

from googlevoice import Voice
from googlevoice.util import input
import sys
import BeautifulSoup
import fileinput

import Listen #A voice recognition script I wrote

def login():
    username, password = "xyz@gmail.com", "******"

    voice = Voice()
    client = voice.login(username, password)
    return client

我所做的唯一不同是更改了一些导入的库,但是我终于可以克服"Email Address:"错误,然后运行其余代码.还没有尝试测试它,但是我仍在发送短信!

The only thing different that I've done is changed some of the libraries I've imported, but I can finally get past that "Email Address: " error, and run the rest of my code. have yet to try and test it my sending a text yet though!

@ Merlin2011和@ jknupp17,非常感谢您的建议!

@Merlin2011 and @jknupp17, thank you so much for your suggestions!

这篇关于Python Google语音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆