【发布时间】:2023-02-02 00:14:24
【问题描述】:
我有一个 python 项目,它将一个 .csv 文件和一些参数作为输入,然后返回一些结果。 每次我想尝试我的代码的新编码功能并获得结果时,我都必须运行更改 .csv 名称和其他参数的程序。所以每次这个参数都需要很长时间才能改变,因为我有很多不同的输入文件。
有一种用 python 编写程序的方法可以为我做这个吗? 例如一个程序:
- run "project.py" n times
- first time with "aaa.csv" file as input and parm1=7, then put results in "a_res.csv"
- second time with "bbb.csv" file as input and parm1=4, then put results in "b_res.csv"
- third time with "ccc.csv" file as input and parm1=2, then put results in "c_res.csv"
- fourth time with "ddd.csv" file as input and parm1=6, then put results in "d_res.csv"
- ...
谢谢!
【问题讨论】:
-
通常,您只需编写一个快速的 shell 脚本来使用不同的参数执行您的 Python 脚本。
标签: python