MCPcopy Create free account
hub / github.com/ZyphrZero/palworld-python-script / package_scripts

Function package_scripts

src/pyinstaller.py:19–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17
18
19def package_scripts():
20
21 if os.path.exists('dist/palworld-python-script.zip'):
22 os.remove('dist/palworld-python-script.zip')
23 print('已删除原dist/palworld-python-script.zip')
24 if os.path.exists('palworld-python-script.zip'):
25 os.remove('palworld-python-script.zip')
26 print('已删除原palworld-python-script.zip')
27
28 scripts = ['task_scheduler.py', 'backup.py']
29 print('正在打包:', scripts)
30
31 for script in scripts:
32
33 command = 'pyinstaller', '--onefile', script
34 subprocess.run(command)
35
36 shutil.copy('config.ini', 'dist')
37
38 shutil.make_archive('palworld-python-script', 'zip', 'dist')
39 print("palworld-python-script 打包成功!")
40
41 shutil.move('palworld-python-script.zip', 'dist')
42 print("打包后的palworld-python-script.zip已放入dist文件夹!")
43
44
45if __name__ == '__main__':

Callers 1

pyinstaller.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected