Some time My G-Sheet blank using python code for export data
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- Ein halber Tag
- Anfängerfreundlichkeit
- 18/100
Rechercherichtung
The report pastes a standalone script whose entry point is main(), which reads SAMPLE_RANGE_NAME = 'Class Data!A2:E' through sheet.values().get(...). Start by reproducing the blank result: check whether values is empty and whether token.pickle or the credential refresh path is involved. The issue gives no exact symptom or expected output, so first ask the reporter for those details. Done means a clear cause is identified, or the issue is closed as not reproducible.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
I a using below code but sometime my google sheet showing blank. I want fix this issues please let me know solution.
from future import print_function
import pickle
import os.path
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://www.googleapis.com/auth/spreadsheets.readonly']
The ID and range of a sample spreadsheet.
SAMPLE_SPREADSHEET_ID = '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms'
SAMPLE_RANGE_NAME = 'Class Data!A2:E'
def main():
"""Shows basic usage of the Sheets API.
Prints values from a sample spreadsheet.
"""
creds = None
# The file token.pickle stores the user's access and refresh tokens, and is
# created automatically when the authorization flow completes for the first
# time.
if os.path.exists('token.pickle'):
with open('token.pickle', 'rb') as token:
creds = pickle.load(token)
# If there are no (valid) credentials available, let the user log in.
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
flow = InstalledAppFlow.from_client_secrets_file(
'credentials.json', SCOPES)
creds = flow.run_local_server(port=0)
# Save the credentials for the next run
with open('token.pickle', 'wb') as token:
pickle.dump(creds, token)
service = build('sheets', 'v4', credentials=creds)
# Call the Sheets API
sheet = service.spreadsheets()
result = sheet.values().get(spreadsheetId=SAMPLE_SPREADSHEET_ID,
range=SAMPLE_RANGE_NAME).execute()
values = result.get('values', [])
if not values:
print('No data found.')
else:
print('Name, Major:')
for row in values:
# Print columns A and E, which correspond to indices 0 and 4.
print('%s, %s' % (row[0], row[4]))
if name == 'main':
main()
- Vorherrschende Sprache
- Python
- Sterne
- 1.4k
- Forks
- 917
- Ø Merge
- 3 Min.
- Gemergte PRs (30 T.)
- 1
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus googleworkspace/python-samples
-
ايقاف البحث الأمنEvtl. wieder frei @sqrrrl hat das vor 400 Tagen übernommen, und es ist kein Pull Request offen. Offen
googleworkspace/python-samples#2434 · 1 zugewiesene Person ·
-
Slow Uploads using Google Drive API with PythonEvtl. wieder frei @sqrrrl hat das vor 740 Tagen übernommen, und es ist kein Pull Request offen. Offen
googleworkspace/python-samples#1852 · 1 Kommentar · 1 zugewiesene Person ·
-
403 error from google after a few successful runs of my codeEvtl. wieder frei @vinay-google hat das vor 912 Tagen übernommen, und es ist kein Pull Request offen. Offen
googleworkspace/python-samples#1424 · 1 zugewiesene Person ·
-
How to see the progress of files which is getting uploadedEvtl. wieder frei @vinay-google hat das vor 928 Tagen übernommen, und es ist kein Pull Request offen. Offen
googleworkspace/python-samples#1404 · 1 zugewiesene Person ·
-
Phyton SamplesEvtl. wieder frei @PierrickVoulet hat das vor 975 Tagen übernommen, und es ist kein Pull Request offen. Offen
googleworkspace/python-samples#1279 · 1 zugewiesene Person ·
Alle Issues in googleworkspace/python-samples
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
readthedocs/readthedocs-builder#73 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: ci bug good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
hffgzktbcc-blip/ounce-core#484 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
vllm-project/vllm-torchtpu#3395 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Hermes plugin: MITM-domain discovery misses the model: block (provider/base_url nested under model:) — traffic blind-tunnels silently, zero compressionEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
ranxianglei/billion-context#7063 ·
Maintainer antworten meist innerhalb von 1 Tag