no out, no tip
The following code produces output indicating that the module was not found, but the module is already installed.
using var pyn = new Pynet(code);
For multi-line Python code that is not defined as a function, the above method of calling it is not concise enough.
How to know if the code executed successfully?
// script "Pynet examples4.cs"
/*/ c Pynet.cs; /*/
using Python.Runtime;
string code = """
import win32print
print(win32print.__file__)
# out print name
default_printer = win32print.GetDefaultPrinter()
print(default_printer)
""";
using var pyn = new Pynet();
PythonEngine.RunSimpleString(code);
The following code produces output indicating that the module was not found, but the module is already installed.
using var pyn = new Pynet(code);
For multi-line Python code that is not defined as a function, the above method of calling it is not concise enough.
How to know if the code executed successfully?