Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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"}
like image 502
Russell Avatar asked Feb 12 '26 11:02

Russell


1 Answers

$outputBox.text = python .\test.py
like image 121
Russell Avatar answered Feb 14 '26 23:02

Russell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!