operating system - .bat file execution in python not giving the required results -
this content of bat file
proselint exe file
proselint c:\users\rahul\desktop\proselint-0.5.3\proselint\proselint\something.md > ooo.txt
running bat file double clicking produces following output
c:\users\rahul\desktop\proselint-0.5.3\proselint\proselint\something.md:2:1: misc.mondegreens 'a girl kaleidoscope eyes' preferred form. c:\users\rahul\desktop\proselint-0.5.3\proselint\proselint\something.md:1:38: misc.mondegreens 'laid him on green' preferred form.
which correct output in ooo.txt when try run bat python script following output
c:\users\rahul\desktop\proselint-0.5.3\proselint\proselint>proselint c:\users\rahul\desktop\proselint-0.5.3\proselint\proselint\something.md 1>ooo.txt
which nothing command executed python code used was:
import os os.system("c:/users/rahul/desktop/proselint-0.5.3/proselint/proselint/command.bat")
note : using subprocess gives me same output ooo.txt
from subprocess import call call("c:/users/rahul/desktop/proselint-0.5.3/proselint/proselint/command.bat")
your .bat file must contain @echo off
in first line, like:
@echo off command parameter > ooo.txt
if not specify @echo
off
every line going executed printed console.
i hope fixes problem.
Comments
Post a Comment