到目前为止,我可以将文件上传到该文件夹(如果存在).我不知道如何创建一个.因此,如果文件夹不存在,我的脚本就会死掉.
import sys
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
gpath = '2015'
fname = 'Open Drive Replacements 06_01_2015.xls'
gauth = GoogleAuth()
gauth.LocalWebserverAuth()
drive = GoogleDrive(gauth)
file_list = drive.ListFile({'q': "'root' in parents and trashed=false"}).GetList()
for file1 in file_list:
if file1['title'] == gpath:
id = file1['id']
file1 = drive.CreateFile({'title': fname, "parents": [{"kind": "drive#fileLink","id": id}]})
file1.SetContentFile(fname)
file1.Upload()
Run Code Online (Sandbox Code Playgroud)
你可以帮我修改上面的代码来创建文件夹gpath,如果它不存在吗?
无法验证您的应用程序。我们无法创建身份验证会话
获取状态时,命令行上的 MacOS 公证返回“不支持的 url”
xcrun altool --notarize-app --primary-bundle-id "com.xx" --username “xx@mac.com” --password "xxx" --asc-provider "xx" --file xxx.kext.zip
Run Code Online (Sandbox Code Playgroud)
上面的命令给了我以下错误,如果有人遇到类似的问题,请告诉我如何解决问题
altool[4753:1282542] *** Error: Unable to validate your application. We are unable to create an authentication session.
Run Code Online (Sandbox Code Playgroud) 我想添加我的应用程序,所以当我右键单击文件时,它会显示Send To> My App.
如果可能的话,当我点击SendTo按钮时,我怎样才能获得Selected文件......?我以前没有尝试过任何东西,甚至找不到可以提供帮助的东西.谢谢:=)
我有一个字符串
str_sample = "[[1, 2], [2.0, 0.3], ['a', 'b', [None, (1, 3)], {'c': 'd'}]]"
Run Code Online (Sandbox Code Playgroud)
我目前正在使用:
exec("str2list_sample = "+ str_sample)
Run Code Online (Sandbox Code Playgroud)
这样做有更清洁的方法吗?