Reputation: 45
I want to execute a Python 3.5 file in my UWP application.
The App is just for my personal use, so it doesn't need to run on any pc. I want to execute the Python file with the installed Python interpreter; So no need for IronPython (I know that doesn't work with UWP).
The Python script can be handled as a black box. I just want to run the script.
Upvotes: 0
Views: 1350
Reputation: 39102
Unfortunately not in pure UWP app as this does not allow you to start processes, which would be necessary to get the Python interpreter running. Luckily, there are alternatives.
One is to launch a full-trust process from your UWP app which can be a console app with Iron Python and which will execute the script. See great series of blog posts by Stefan Wick on implementing Full Trust.
Alternatively, you can use the UWP Desktop Bridge to do what you need. This way you can build a classic desktop application (for example with WPF), install the Iron Python package from NuGet and execute your script right from the app. You can then package the result as a UWP. Thanks to the Desktop Bridge you can then distribute the app normally via the Microsoft Store.
Upvotes: 1