I am new to Python and new to working with APIs so this is probably basic...I can make my initial request that causes the browser window to open. At that point the user has to make their selection on the Google consent page. After that the authorization code is returned...I get all that. My question is, how do I pause my python code from running so I can wait for the user permission and store the code I need for the next step? I am just testing it in Python 2.7 using their libraries, but I am stuck on this point. What can I put at the arrow? Appreciate any assistance.
from oauth2client.client import OAuth2WebServerFlow
import webbrowser
flow = OAuth2WebServerFlow(client_id=[id],
client_secret=[secret],
scope='https://www.google.com/m8/feeds',
redirect_uri='urn:ietf:wg:oauth:2.0:oob')
auth_uri = flow.step1_get_authorize_url()
webbrowser.open(auth_uri)
--->
code=''
credentials = flow.step2_exchange(code)