当使用py2app构建时无法保存在文件夹中

时间:2019-11-16 02:08:24

标签: python python-3.x py2app

当我使用py2app构建python脚本时,它们不会将文本文件保存在文件夹中。在空闲状态下正常工作

name = first_name() + ' ' + last_name()
save_path = os.path.expanduser('~/Desktop/Folder')
name_of_file = name
completeName = os.path.join(save_path, name_of_file + ".txt")

with open(completeName, 'w') as f:
    print('1st line', file=f)

0 个答案:

没有答案