Python 3.x 如何使用Python从Google Drive下载管道分隔格式的Google工作表(不是工作簿)

Python 3.x 如何使用Python从Google Drive下载管道分隔格式的Google工作表(不是工作簿),python-3.x,google-drive-api,google-api-python-client,google-drive-realtime-api,google-sheets-api,Python 3.x,Google Drive Api,Google Api Python Client,Google Drive Realtime Api,Google Sheets Api,我正在编码使用GoogleDrive api从GoogleDrive下载一个文件到本地系统。下面是我的代码。我有以下问题: 1) 有没有办法指定只下载工作簿或完整工作簿中的工作表编号 2) 我们有MIMETYPE“text/csv”,有没有一种方法可以使用其他分隔符(例如,管道)保存它们 3) 我们可以指定下载的位置吗?现在它正在下载python脚本所在的位置 from apiclient.discovery import build from httplib2 import Http from

我正在编码使用GoogleDrive api从GoogleDrive下载一个文件到本地系统。下面是我的代码。我有以下问题:

1) 有没有办法指定只下载工作簿或完整工作簿中的工作表编号

2) 我们有MIMETYPE“text/csv”,有没有一种方法可以使用其他分隔符(例如,管道)保存它们

3) 我们可以指定下载的位置吗?现在它正在下载python脚本所在的位置

from apiclient.discovery import build
from httplib2 import Http
from oauth2client import file , client , tools
import io
from apiclient.http import MediaIoBaseDownload


try:
    import argparse
    flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()
except ImportError:
    flags = None

#Set the scope for authorization and specify json file    
SCOPES = 'https://www.googleapis.com/auth/drive'
CLIENT_SECRET = 'client_secret.json'

#Atleast once we will have to allow our program to access document, after that it would be stored in storage.json file
store = file.Storage('storage.json')
credz = store.get()
if not credz or credz.invalid:
    flow = client.flow_from_clientsecrets(CLIENT_SECRET , SCOPES)
    credz = tools.run_flow(flow,store,flags)\
            if flags else tools.run(flow,store)
DRIVE = build('drive','v2',http=credz.authorize(Http()))

MIMETYPE='text/csv'
file_id='1p3yRgi093TKbsBrxkUkV1cP-6h8dWUIKXycU62i9Arc'
request = DRIVE.files().export_media(fileId=file_id,mimeType=MIMETYPE)

fh = io.FileIO('Google App Scripts for beginner.csv','wb')
downloader = MediaIoBaseDownload(fh, request)
done = False
while done is False:
    status, done = downloader.next_chunk()
    print ("Download %d%%." % int(status.progress() * 100))