我正在尝试将文件上传到我的 Google 驱动器,下面的代码有效。如何指定要上传到哪个文件夹,即驱动器---与我共享--csvFolder
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
gauth = GoogleAuth()
gauth.LocalWebserverAuth()
drive = GoogleDrive(gauth)
file2 = drive.CreateFile()
file2.SetContentFile('new_test.csv')
file2.Upload()
Run Code Online (Sandbox Code Playgroud) s=['Closure Type: Button', 'Fit: Regular', 'Neckline: Collar Neck',
'Sleeve Length: Long Sleeve', 'Sleeve Style: Cuffed Sleeve']
Run Code Online (Sandbox Code Playgroud)
您好,我正在尝试将以上列表转换为一本词典
键对于我需要更改的所有字符串不是恒定的。
我试过了
data={{k:v} for i in s for k,v in i.split(': ')}
json.loads(s)
Run Code Online (Sandbox Code Playgroud)
但我明白了
ValueError:太多值无法解包(预期2)
我的预期输出是:
data={'Closure Type':'Button','Fit':'Regular','Neckline':'Collar Neck',
'Sleeve Length':'Long Sleeve','Sleeve Style':'Cuffed Sleeve'}
Run Code Online (Sandbox Code Playgroud)