擅长:python、mysql、java
<p>您可以将该调用的结果存储到一个变量中,处理它,然后返回它</p>
<pre><code>@app.route('/')
def index():
if 'credentials' not in flask.session:
return flask.redirect('authorize')
credentials = google.oauth2.credentials.Credentials(
**flask.session['credentials'])
client = googleapiclient.discovery.build(
API_SERVICE_NAME, API_VERSION, credentials=credentials)
# Here is your variable
channels = channels_list_by_username(client,
part='snippet,contentDetails,statistics',
forUsername='username')
# Process it
print(channels)
# Add other processing stuff here
# Return it
return channels
</code></pre>