Home:ALL Converter>How to run Windows powershell script from python?

How to run Windows powershell script from python?

Ask Time:2021-02-08T04:36:05         Author:IlyessD

Json Formatter

I would like to run a script like in the picture in the Powershell but from python. [1]: https://i.stack.imgur.com/K7XGI.png For instance, I would like to have a code like this:

def run(namefile):
    command that opens powershell
    command that type in the powershell .\spim.exe .\namefile.txt
    command that run the script

Does someone know how to do this ?

Author:IlyessD,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/66092844/how-to-run-windows-powershell-script-from-python
yy