首页 > 解决方案 > 如何使用 for 循环运行多个解析 python 代码?

问题描述

我是python社区的初学者。我想通过在命令行(mac终端)中使用for循环来运行解析python代码从现在开始我已经在命令行中运行了。

“python3 xxxx.py --iter 1000 --outdir xxxx/xxxx/xxxx/xxxx”

但是,它只能具体一点。

所以我想通过使用 for 循环将 iter 1000 更改为 10000 (1000, 2000, 3000, ..., 10000) 来运行。例如,

“python3 xxxx.py --iter 1000 --outdir xxxx/xxxx/xxxx/xxxx”

“python3 xxxx.py --iter 2000 --outdir xxxx/xxxx/xxxx/yyyy”

“python3 xxxx.py --iter ....--outdir xxxx/xxxx/xxxx/....”

“python3 xxxx.py --iter 10000 --outdir xxxx/xxxx/xxxx/zzzz”

像那样。

我能做些什么..?请给我一些意见或解决方案。谢谢。

标签: python-3.xparsing

解决方案


推荐阅读