How do I use output from python script in my Powershell application?

时间:2016-07-11 20:33:05

标签: python powershell

I have a power-shell GUI Application. Inside my application I call a python script. I want to display the output of the python script.

test.py prints "hello world"

$dog.Add_Click({FixIndefinite}) 
$Form.Controls.Add($dog)


function FixIndefinite {
try { $outputBox.text = "Welcome"
      python .\test.py

    }
catch {$outputBox.text = "`nOperation could not be completed"}

1 个答案:

答案 0 :(得分:1)

$outputBox.text = python .\test.py