Is it possible to integrate Python 3 and C #?
There is an application on C # in which I want to make a scripting functionality in mind Python 3 scripts. It would be especially good if Python was compiled in MSIL and could use CLR assemblies, but, as I understood, IronPython supports only 2.7.
If it is impossible, are there any other scripted languages, well integrated with CLR (not only at the Interop level)?
Answer 1, Authority 100%
In IronPython, I wanted to add support for Python 3, but Microsoft stopped supporting development, and the main development went to another company. Since the teams are no longer, it is actively developing the IronPython no one. Ironpython and IronRuby are designed at the expense of Microsoft, then they have an interest in the DLR, and they threw the code into Open-Sort. The last time I looked, the branch for the third python was sluggishly developed. It is so, historical reference.
And now to the case. What is not satisfied with Python 2.7? If Unicode, then in IronPython all lines and so unicode.
If you want a close connection with .NET, then this is one of the best options. The relationship with .NET is full and very detailed.
I can understand if you already have a layer of code on Python 3 or the urgent need for new features of the third version of the language. But in the conditions when the application simply needs to add scripts, oriented stands to several other parameters: how much the language is distributed, as far as the interoperability is realized.
Answer 2, Authority 40%
about other languages.
PowerShell. Script language that originally works in CLR. From here – transparent work with any objects.
C # itself. The command line mode, of course, is not supported – but the script is in the file, can be compiled on the fly and execute.
found IronPython for Raspiton. Last Commit 3 months ago
You can also use the 3TO2 (in order to convert Python 3 code into Python 2 code ) and use a stable official version:
$ PIP Install 3TO2
$ 3TO2 manifest_parser.py -w
... the output is omitted ...
Python 2.7.6 (Default, Mar 22 2014, 22:59:38)
[GCC 4.8.2] ON Linux2
Type "Help", "Copyright", "Credits" or "License" for more information.
... Import Manifest_Parser.
And no exceptions
Use a separate application on C # and a separate process on python, communication – via SOAP or XML-RPC. Queries and answers can be driven by stdin / stdout, you can via HTTP, you can via MQ …
The advantage of this method is a priori opportunity to use the version of the language that seems most beautiful.
and another communication option. You can make the main application on python, and portion on C # do as a library. The module for CPYthon can be easily written on C++ / CLI.