无法打开应用程序“”。在python macos中使用zipfile进行提取后
在使用python从服务器中提取构建然后提取之后,我无法启动应用程序。我收到错误消息“应用程序”“无法打开”,在内容中的可执行文件上尝试了chmod+x,然后应用程序启动到黑屏。同样的代码似乎也适用于我的windows。有什么想法吗 这是我的密码无法打开应用程序“”。在python macos中使用zipfile进行提取后,python,macos,desktop-application,zipfile,Python,Macos,Desktop Application,Zipfile,在使用python从服务器中提取构建然后提取之后,我无法启动应用程序。我收到错误消息“应用程序”“无法打开”,在内容中的可执行文件上尝试了chmod+x,然后应用程序启动到黑屏。同样的代码似乎也适用于我的windows。有什么想法吗 这是我的密码 import glob, shutil, os, zipfile, send2trash source = '/my/build/location' target = '/my/directory' def getLatestBuild(sourc
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)
似乎问题在于符号链接被破坏 正萃取物
-rw-r--r-- 1 daniel staff 29B 22 Aug 17:36 QtConcurrent
-rw-r--r-- 1 daniel staff 26B 22 Aug 17:36 Resources
drwxr-xr-x 4 daniel staff 136B 22 Aug 17:36 Versions
蟒蛇提取物
lrwxr-xr-x 1 daniel staff 29B 22 Aug 17:37 QtConcurrent -> Versions/Current/QtConcurrent
lrwxr-xr-x 1 daniel staff 26B 22 Aug 17:37 Resources -> Versions/Current/Resources
drwxr-xr-x 4 daniel staff 136B 22 Aug 17:37 Versions
使用标准OSX工具提取时按预期工作
os.system("unzip -q -o %s -d %s" % (target_build, target))
如何运行您的脚本?Hi Iv从terminal和Idle都尝试过,解压文件时得到了什么?解压后的分机是什么?