小编Ste*_*hen的帖子

Gmail API:如何获取邮件正文?

根据下面引用的文档,消息应包含 MessagePart,而 MessagePart 又应包含 MessagePartBody。

https://developers.google.com/gmail/api/reference/rest/v1/users.messages#Message

当我运行下面的代码时(这只是此处找到的示例脚本的修改版本,其中消息替换为标签)

from __future__ import print_function
import pickle
import os.path
import openpyxl
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request

# If modifying these scopes, delete the file token.pickle.
SCOPES = ['https://mail.google.com/']

def main():
    """Shows basic usage of the Gmail API.
    Lists the user's Gmail labels.
    """
    creds = None
    # The file token.pickle stores the user's access and refresh tokens, and is
    # created automatically when the authorization …
Run Code Online (Sandbox Code Playgroud)

python google-api oauth-2.0 gmail-api

3
推荐指数
1
解决办法
9389
查看次数

seaborn 未按预期使用 set_xticklabels()

我正在尝试更改 seaborn 折线图上 x 轴标签的旋转。然而,当我运行下面的代码时,我只得到一个大列表作为输出和一个没有 x 标签的图表:

sns.set(rc={'figure.figsize':(15,5)})
chart = sns.lineplot(y = top_deaths['Deaths'], x = top_deaths['Date'], data = top_deaths, hue ='Country/Region')
x = chart.get_xticklabels()
chart.set_xticklabels(x, rotation = 45)


[Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, 0, ''),
 Text(0, …
Run Code Online (Sandbox Code Playgroud)

python seaborn x-axis

2
推荐指数
1
解决办法
760
查看次数

标签 统计

python ×2

gmail-api ×1

google-api ×1

oauth-2.0 ×1

seaborn ×1

x-axis ×1