python - 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
.
推荐阅读
- apache-spark-sql - 为 Databricks 增量合并设置标志 I 或 U
- typescript - 如何获取Angular组件中所有导入的列表
- azure - 将多个用户分配给 Azure Devops 中的任务
- css - 我如何在下面的代码中使用 CSS 活动属性,它不能正常工作
- reactjs - Material UI DataGrid/XGrid 是否支持 IE 11?
- ios - swift 我想将从图库中选择的图像作为链接传递给下一个视图控制器
- android - 如何使用响应数据在 recyclerview 中显示数据
- c++ - 解决方案在第 12 行执行时出现错误“超出范围”
- c# - 获取 URL 响应以创建 TEAMs 会议
- single-sign-on - Spring Cloud Dataflow Keycloak SSO 集成注销问题