Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 如何使用Oauth在python中验证gmail?_Python 2.7_Oauth 2.0_Gmail Api_Gmail Imap - Fatal编程技术网

Python 2.7 如何使用Oauth在python中验证gmail?

Python 2.7 如何使用Oauth在python中验证gmail?,python-2.7,oauth-2.0,gmail-api,gmail-imap,Python 2.7,Oauth 2.0,Gmail Api,Gmail Imap,我正在尝试登录gmail并阅读收件箱中的信息(主题、内容)。 我有登录和阅读信息的基本代码。但我不能这么做。原因是,我将不得不使用Oauth对gmail中的设置进行身份验证或更改为“允许较不安全的应用程序在上运行”(我尝试过,它正在运行)。但我不想使用第二个选项来更改设置。如何使用Oauth/Oauth2登录到gmail并阅读收件箱消息、主题和内容(Python代码)?您可以查看这篇文章,其中介绍了Oauth 2.0、何时使用、如何获取客户端ID以及如何将其与Google API Python客

我正在尝试登录gmail并阅读收件箱中的信息(主题、内容)。 我有登录和阅读信息的基本代码。但我不能这么做。原因是,我将不得不使用Oauth对gmail中的设置进行身份验证或更改为“允许较不安全的应用程序在上运行”(我尝试过,它正在运行)。但我不想使用第二个选项来更改设置。如何使用Oauth/Oauth2登录到gmail并阅读收件箱消息、主题和内容(Python代码)?

您可以查看这篇文章,其中介绍了Oauth 2.0、何时使用、如何获取客户端ID以及如何将其与Google API Python客户端库一起使用。该库包含在Google API Python客户端库中。它处理进行API调用所需的OAuth 2.0协议的所有步骤。如果您只需要OAuth 2.0库,则可以将其作为单独的库提供。以下各节介绍此库的重要模块、类和函数

检查一下Gmail API。

你可以检查一下这个,它描述了OAuth 2.0,何时使用它,如何获取客户端ID,以及如何在Google API Python客户端库中使用它。该库包含在Google API Python客户端库中。它处理进行API调用所需的OAuth 2.0协议的所有步骤。如果您只需要OAuth 2.0库,则可以将其作为单独的库提供。以下各节介绍此库的重要模块、类和函数


检查一下Gmail API。

Google有一个很好的Python快速入门指南。你试过什么,什么不起作用?谷歌有一个很好的Python快速入门指南。你试过什么,什么不起作用?