Get outputs of IronPython live in C#(WPF)?
Juliette
1
Reputation point
I am developing an app in C# WPF. The app should call Python scripts. I use IronPython for this. Unfortunately I have some difficulties. I don't get the prints from Python displayed live.
Is it possible to display the output of Print live in TextBox(like in Python IDE)?
namespace PythonCall
{
public class MainViewModel : BaseViewModel
{
public string PyOutput { get; set; }
public RelayCommand Cmd { get => new RelayCommand(Exec); }
private void Exec(object parameter)
{
switch (parameter.ToString())
{
case "Start":
try
{
ScriptConfig();
OnPropertyChanged(nameof(PyOutput));
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
break;
default:
break;
}
}
public void ScriptConfig()
{
}
}
}
The variable "PyOutput" is prepared for this and this is the binding to TextBox.
Any help is appreciated
Developer technologies Windows Presentation Foundation
2,854 questions
Sign in to answer