通过批处理运行日志记录python脚本

时间:2013-05-24 05:34:11

标签: batch-file

我有一个名为“AI_V.0.0.0.1_G.1.py”的python脚本。

当脚本启动时,我用时间定义了当前时间,所以我这样做了:

set currenttime=%time%

如果我刚跑:

AI_V.0.0.0.1_G.1.py

然后它最终完美。问题是我需要记录它。当我运行时:

AI_V.0.0.0.1_G.1.py>>%currenttime%.log

然后它说

The system cannot find the path specified.

任何帮助?

1 个答案:

答案 0 :(得分:1)

试试这个,它使用%time%并用:替换- 例如18-04-54.22.log

AI_V.0.0.0.1_G.1.py>>%time::=-%.log