问题举例:
test.py文件:print("hello")
test.bat文件:@echo off
cd Z:\python
start python test.py >> Z:\python\data.txt
test.py内容一句话:print("hello")
test.bat内容:@echo on
cd Z:\python
start python test.py >>Z:\python\data.txt
出不来结果,我查了资料,又写了一个bat文件:
test1.bat内容:@echo off
cd Z:\python
call "test.bat" >>Z:\python\data.txt
start notepad Z:\python\data.txt
这样就在data中出现test.bat文件的内容,并不是我想要的结果。
任务一: 编写 bat文件完成运行 py文件,把返回值存在 text文件中。
任务二:能把结果存在excel文件中吗,我想对结果进行分析,提供思路即可。
返回值存在 text文件, 这个用python写就好,存excel用python的pandas库就好:
test.py内容一句话:print("hello")
test.bat内容:@echo on
cd Z:\python
start python test.py >>Z:\python\data.txt
出不来结果,我查了资料,又写了一个bat文件: