我无法在使用python从服务器提取构建然后提取之后启动应用程序。我收到错误消息“The application”“cannot be open”Iv在内容中的可执行文件上尝试chmod+x,然后应用程序启动到黑屏。同样的代码似乎也适用于windows。有什么想法吗?你知道吗
这是我的密码
import glob, shutil, os, zipfile, send2trash
source = '/my/build/location'
target = '/my/directory'
def getLatestBuild(source, target):
list_of_files = glob.glob(source + '/*.zip')
latest_file = max(list_of_files, key = os.path.getctime)
print(latest_file + '\n\nDownloading\n\n----------')
shutil.copy(latest_file, target)
return latest_file
def change_dir(latest_file):
directory, file = os.path.split(latest_file)
target_build = os.path.join(target, file)
return target_build
def extractZip(target_build):
zip_ref = zipfile.ZipFile(target_build, 'r')
print('Unzipping' + target_build + '\n\n----------')
zip_ref.extractall(target)
print('file has been extracted\n\n---------')
zip_ref.close()
send2trash.send2trash(target_build)
print(target_build + ' has been sent to trash')
latest_file = getLatestBuild(source, target)
target_build = change_dir(latest_file)
extractZip(target_build)
似乎问题是由于符号链接被破坏。你知道吗
正常提取物
Python提取物
使用标准OSX工具提取时按预期工作
相关问题 更多 >
编程相关推荐