I am trying to execute a Python Script on a C# Application. So I choose Iron Python, I have managed to execute basic code.
But while using libraries like xml or json. I cannot import and use them. I've tried a lot,but nothing works out.
The main thing which I tried was to copy the xml librairy in my C# project folder, and then import it using the following code:
import clr
clr.AddReferenceToFileAndPath("..\\ElementTree.py")
import ElementTree as ET
clr.AddReferenceToFileAndPath("..json\\__init__.py")
import json
But i get this error :
System.BadImageFormatException: 'The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)'
Can someone provide me a with a good solution?
If you need more details, please comment the question.
Thanks in advance
User contributions licensed under CC BY-SA 3.0