lundi 13 juin 2016

.bat file execution in python not giving the required results


This is the content of my bat file

Proselint is an exe file

proselint C:UsersRahulDesktopproselint-0.5.3proselintproselintsomething.md > ooo.txt

Running the bat file by double clicking it produces the following output

C:UsersRahulDesktopproselint-0.5.3proselintproselintsomething.md:2:1: misc.mondegreens 'a girl with kaleidoscope eyes' is the preferred form.
C:UsersRahulDesktopproselint-0.5.3proselintproselintsomething.md:1:38: misc.mondegreens 'laid him on the green' is the preferred form.

Which is the correct output in ooo.txt But when i try to run the bat from a python script I get the following output

C:UsersRahulDesktopproselint-0.5.3proselintproselint>proselint C:UsersRahulDesktopproselint-0.5.3proselintproselintsomething.md 1>ooo.txt

Which is nothing but the command which was to be executed The python code used was:

import os
os.system("C:/Users/Rahul/Desktop/proselint-0.5.3/proselint/proselint/command.bat")

Note : Using SubProcess also gives me the same output to the ooo.txt


Aucun commentaire:

Enregistrer un commentaire