简体   繁体   中英

Python Creating a 7zip archive with command line

So I am trying to run a command line argument to create a 7zip archive as below:

rc = subprocess.run([path, 'a', 'archive.7z', '-psecret', 'mhe', 'log.log'])

However, all it is doing is opening 7zip and not creating archive.7z as intended.

Any reason why?

Adding comment as answer in case others come across this:

When you say 'opening 7zip' I imagine you mean the file manager GUI, which means you are hitting the wrong executable. You want path to end in 7z.exe not 7zFM.exe .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM