简体   繁体   中英

How do I tell which Python interpreter I'm using?

I am using Python 2.5.2. How can I tell whether it is CPython or IronPython or Jython ?

Another question: how can I use a DLL developed in VB.NET in my project?

import platform    
platform.python_implementation()

The above one provide the type of interpreter you use.

If you downloaded it as the default thing from python.org, it's CPython. That's the “normal” version of Python, the one you get when you use the command “python”, and the one you'll have unless you specifically went looking for the projects targeting Java/CIL.

And it's CPython because neither of the other projects have reached version number 2.5.2.

How can i use a dll developed in VB.NET in to my project?

From CPython, using Python-for-.NET (*) and clr.AddReference.

(*: actually a bit of a misnomer, as with CPython in control it is more like .NET-for-Python.)

If you are typing "python" to launch it, it is probably CPython. IronPython's executable name is "ipy".

import sys
print sys.version

Well since the first part of your question has been answered, I'll tackle the second part. .NET dll's can be accessed from python in various ways. If you are using ironpython it makes this especially easy, since all .NET languages can interact with eachother fairly seamlessly. In this case you would access your dll from ironpython just as you would any other .NET dll you made with ironpython. If you want to call a native dll you can use ctypes .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM