我想在python里面实现循环输出文件例如像在linux shell里面的这样
for ((i=1;i<=22;i++)); do sort -k1,1 -k2,2n ./test${i}.txt > ./test${i}.sorted.txt; done
# 这一条命令的输入就是test${i},然后会分别输出到对应sorted.txt文件里面(这是在linux shell脚本里面的写法)
想问如果用python写相同目的的命令怎么写?python能不能实现?
请各位指点一二
我想在python里面实现循环输出文件例如像在linux shell里面的这样
for ((i=1;i<=22;i++)); do sort -k1,1 -k2,2n ./test${i}.txt > ./test${i}.sorted.txt; done
# 这一条命令的输入就是test${i},然后会分别输出到对应sorted.txt文件里面(这是在linux shell脚本里面的写法)
想问如果用python写相同目的的命令怎么写?python能不能实现?
请各位指点一二