导入gspread 从oauth2client.service_account导入ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds'] 凭据= ServiceAccountCredentials.from_json_keyfile_name('96e165f08e7e.json',作用域) 客户端= gspread.authorize(信用)
sheet = client.open(“ AP日报”).sheet1
列表哈希= sheet.get_all_records() 打印(列表哈希)
/ Users / daiou / PycharmProjects / gsworkeditor / venv / bin / python /Users/daiou/PycharmProjects/gsworkeditor/gswoker.py 追溯(最近一次通话): 在第7行的“ /Users/daiou/PycharmProjects/gsworkeditor/gswoker.py”文件中 客户端= gspread.authorize(信用) 授权文件“ /Users/daiou/PycharmProjects/gsworkeditor/venv/lib/python3.6/site-packages/gspread/init.py”,授权 client.login() 登录文件“ /Users/daiou/PycharmProjects/gsworkeditor/venv/lib/python3.6/site-packages/gspread/client.py”,第51行 self.auth.refresh(http) 刷新文件“ /Users/daiou/PycharmProjects/gsworkeditor/venv/lib/python3.6/site-packages/oauth2client/client.py”,第545行 self._refresh(http) _refresh中的文件“ /Users/daiou/PycharmProjects/gsworkeditor/venv/lib/python3.6/site-packages/oauth2client/client.py”,行749 self._do_refresh_request(http) _do_refresh_request中的第780行的文件“ /Users/daiou/PycharmProjects/gsworkeditor/venv/lib/python3.6/site-packages/oauth2client/client.py” 正文=正文,标题=标题) 请求中的文件“ /Users/daiou/PycharmProjects/gsworkeditor/venv/lib/python3.6/site-packages/oauth2client/transport.py”,第282行 connection_type = connection_type) 1991年,文件“ /Users/daiou/PycharmProjects/gsworkeditor/venv/lib/python3.6/site-packages/httplib2/init.py” 快取键, _request中的第1651行,文件“ /Users/daiou/PycharmProjects/gsworkeditor/venv/lib/python3.6/site-packages/httplib2/init.py” conn,request_uri,方法,主体,标头 _conn_request中的文件1557行中的“ /Users/daiou/PycharmProjects/gsworkeditor/venv/lib/python3.6/site-packages/httplib2/init.py”文件 conn.connect() 在连接中的文件“ /Users/daiou/PycharmProjects/gsworkeditor/venv/lib/python3.6/site-packages/httplib2/init.py”中,第1391行 提高socket_err 在连接中的文件“ /Users/daiou/PycharmProjects/gsworkeditor/venv/lib/python3.6/site-packages/httplib2/init.py”中,第1326行 self.sock = self._context.wrap_socket(袜子,server_hostname = self.host) wrap_socket中的文件“ /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py”,第407行 _context =自我,_session =会话) init 中的文件“ /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py”,第817行 self.do_handshake() 在do_handshake中的文件“ /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py”,行1077 self._sslobj.do_handshake() 文件“ /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py”,行689,在do_handshake中 self._sslobj.do_handshake() ConnectionResetError:[Errno 54]对等重置连接
以退出代码1完成的过程