Reputation: 958
I've already read and researched all over the net including here: Windows Universal Apps: Call python method from C# [closed]
And I understand that UWP is a sandbox and can't open other processes. Nonetheless, I got no other choice but to use python API inside UWP app. The answer in the link above is not clear enough for me and I hope to get any solution, even if it's not a direct one.
Of course I tried IronPython which is not working. And Process/ProcessInfo which brigs-up "access denied". Azure is also not an option.
Thanks.
Upvotes: 0
Views: 3120
Reputation: 13850
If your app is intended to run on the Python script only on PC (and not on phones, HoloLens, xbox, etc.) then you can use an API from the UWP desktop extension SDK:
This API allows you to launch regular full trust EXEs that are included in your app package from your UWP. Those EXEs will then run outside of the appcontainer sandbox and you can execute things like Python scripts (and many more scenarios). When using this API your app can continue to be run on HoloLens etc., but it won't be able to launch those full trust processes on those platforms.
I have a tutorial on this topic on my blog: https://stefanwick.com/2018/04/06/uwp-with-desktop-extension-part-1/
Upvotes: 2