由于我无法通过文档理解,请帮助我在哪里输入电子邮件id和密码,如果我想使用测试.py举个例子。在
from gpapi.googleplay import GooglePlayAPI, RequestError
import sys
import argparse
ap = argparse.ArgumentParser(description='Test download of expansion files')
ap.add_argument('-e', '--email', dest='email', help='google username')
ap.add_argument('-p', '--password', dest='password', help='google password')
args = ap.parse_args()
server = GooglePlayAPI('it_IT', 'Europe/Rome')
# LOGIN
print('\nLogging in with email and password\n')
server.login(args.email, args.password, None, None)
gsfId = server.gsfId
authSubToken = server.authSubToken
print('\nNow trying secondary login with ac2dm token and gsfId saved\n')
server = GooglePlayAPI('it_IT', 'Europe/Rome')
server.login(None, None, gsfId, authSubToken)
# SEARCH
apps = server.search('telegram', 34, None)
print('\nSearch suggestion for "fir"\n')
print(server.searchSuggest('fir'))
print('nb_result: 34')
print('number of results: %d' % len(apps))
print('\nFound those apps:\n')
for a in apps:
print(a['docId'])
我重新编写了其中的一些,对其进行了更新(Python3.7),并使用全局变量代替系统参数(命令行)。我最好使用GitHub页面和源代码对其进行注释。在
PS:坚持使用PEP 8来编码样式、约定、命名等。因为您刚刚起步,所以它对于编写您自己的程序以及理解其他程序非常有用。在
资源
相关问题 更多 >
编程相关推荐