IronPython 3 support? - python

Yes, I know about IronPython 3 compatibility, but that is from two years ago. I was searching on the internet but couldn't find any information on this that is up-to-date.
So does IronPython support Python 3? If not, how many of the future imports work, and are there any Iron-specific ways to make it seem more like Python 3?

Currently it doesn't support Python3. IronPython3 Todo. All future imports supported by the standard Python 2.7 interpreter should be supported by the newest version of IronPython.
And there are no Iron-specific ways to make it seem more like Python3 as far as I know.

IronPython 3 is once again alive. An alpha for Python 3.4 was released in April 2021. It is a very active effort which is being supported by the .NET Foundation. More here: Python 3.4 Release Notes

You can use ExaScript, a fork of the IN-DEVELOPMENT IronPython 3, providing standard Python libraries along with multiple specialty libraries, such as PowerCrypt4, a cryptography library, OmniBeanLib, a library containing lots of common functions, and OmniBeanEB, a rewrite of the Small Basic Library that provides almost every function necessary to build a good GUI/Console application.
Best of all, for making Windows Forms applications, use EPFramework, an included library to generate a fresh, reactive, modern UI for your project.

Related

Confusion transitioning from Python 2 to Python 3: Why support both?

Context: migrating Python 2 app to Python 3
In the docs here: https://docs.python.org/3/howto/pyporting.html
They mention:
Once your dependencies are no longer blocking you, use continuous integration to make sure you stay compatible with Python 2 & 3 (tox can help test against multiple versions of Python; pip install tox)
If you are no longer blocked by your source code nor your dependencies to fully transition to Python 3, why would you continue to also support Python 2?
Is that only a consideration for when you might have users on both Python 2 and Python 3?
If nothing imports my Python app, then there's no risk in fully migrating to Python 3 and dropping Python 2 support, correct?
If you are no longer blocked by your source code nor your dependencies to fully transition to Python 3, why would you continue to also support Python 2?
Nowadays you would probably not bother supporting Python 2 in a stand-alone app, but when that document was written, Python 2 was the norm, so supporting both versions was essential for widely used applications and libraries.
Is that only a consideration for when you might have users on both Python 2 and Python 3?
Yes
If nothing imports my Python app, then there's no risk in fully migrating to Python 3 and dropping Python 2 support, correct?
It depends on the user base that your app targets. You can expect most personal / consumer users to have Python 3 on their machines, or to be able to install it if it is not present or not the default Python (though note installing Python 3 may non-trivial for non-technical users).
Commercial or institutional users may be required to use operating systems that don't have Python 3 installed, and may not have the rights to install Python 3 themselves. In this case you would need to support Python 2 until these organisations upgrade to a suitable OS version.
You missed that the document starts with the assumption you want to support both:
With Python 3 being the future of Python while Python 2 is still in active use, it is good to have your project available for both major releases of Python. This guide is meant to help you figure out how best to support both Python 2 & 3 simultaneously.
That's the premise of the document, and it is only natural that it then tells you how to keep your code compatible. Yes, the Python core team will end support entirely in a a short few months time, but that doesn't mean that this document was written with that in mind.
You can use the document to port to Python 3, and then drop Python 2 support entirely, yes, that's fine too.
Yeah I think they are still supporting that keeping legacy Python 2 code in mind.
python 2 will be left not updated very soon so it's better to consider shifting to 3
This topic is particularly germane if you have developed code for the Python Package Index (PyPI) in Python 2 and are porting it to support both Python 2 and Python 3. You will have a "customer base" for both versions for at least the short foreseeable future.

Python 2.7 or 3.3 for learning Django

I am interested in learning Python but I don't know which version I should chose. When I Googled, I got answers posted over a year ago. If I want to learn Django, which version will be useful and will get support?
Note that I know C, C++, Java and C#.
Django only has experimental support for Python 3, so you'll have to go with Python 2.7 for now.
First, a short comparison is It's Better than 2.7 and When should Python 3.3 become the default. However, remember that Python is in fact a script language and you can use C or C++ in doing modules with new capabilities.
I would recommend to start with python 2.7, it just more commonly used nowadays, and django is written in 2.7 AFAIK.
Apparently the answer you found still holds:
Should we use python 2.6 or 2.7 or 3.x?
If you already know several languages then learn both Python 2 and 3. The difference is small enough to allow many projects to support both versions using single (the same) source code.
For actual deployment you might prefer Python 2.7 if you need to use dependencies that are not ported to Python 3.

What versions of Python are in current use, and packages should support?

As a small-time Python package writer (cobs, simplerandom), I'm wondering what Python versions I should support.
I've heard anecdotally that Python 2.5 is still in use on enterprise type servers. So I thought 2.5 was the oldest that needed to be practically supported, here in 2011.
However, I saw this blog in which the author says he's still using 2.4. From memory, I saw an e-mail on the PyCrypto mailing list saying they aimed to keep support going back to 2.2 if possible.
Of course, then there's Python 3.x which is slowly gaining momentum. It would be good to know who is using that.
Then, there is also Jython and Ironpython, and I have very little idea about them.
Is there any concrete and up-to-date Python installation/usage data available to enlighten us? Is there any "best practices" or other advice for what versions/flavours of Python a package writer should aim to support?
I think that this is a problem that's simply inherent when developing any software. Anyone could be running any version and would need support for that version (I wonder how many people are still running Windoze ME out there? ;)). Personally, when developing libraries, I'll support only support the current version+. If for no other reason, because I'm only one person and I don't have a team.
Having said that, I'd stick my packages up on github and take patches from anyone who wants support for previous versions (and is willing to put in the work).
Edit:
I've found that a good rule in software development (especially packages) is develop only for what is needed, not what you think might be needed. In other words, get it working for whatever version of Python you're running (or is dearest to you) and then take support requests if you want to implement them yourself as people need them.
I have servers that run Python 2.3. :-)
But no, you don't need to support it. Most servers like that are just running, and do not get any new modules installed.
When creating a new module today, 2.6, 2.7, 3.1 and 3.2 is the versions to support. For existing modules you can ask your users. :-)
You should support the latest of the 2.x series (2.7 as of now) and 3.x (3.2 as of now). Unless you have a specific need for supporting older versions, I don't think you need to go there.
As for alternate implementations like IronPython and Jython, you should do that only if needed. It can be time consuming (although perhaps educational) to support you app for all these implementations.
As a side node, to test your app on multiple versions/implementations of Python, I recommend tox.

I want to use ZopeInterfaces, however my project is based on Python 3.x - any suggestions?

Zope Interfaces are a great way to get some Java-style "design by contract" into a python program. It provides some great features such as implement-able interfaces and a really neat pattern for writing adaptors for objects.
Unfortunately, since it's part of a very mature platform which runs just fine on Python 2.x the developers of Zope.Interface have not yet prioritised porting to Python 3. I'd probably do the same in their situation. :-)
What I want to know is:
Is there another way to achieve a similar effect on the 3.x platform? I want to use the same kinds of patterns that Zope.Interface makes easy but I don't want to roll my own interfaces system. Or I should just forget about interfaces for now and design around this problem.
There appears to be a Python 3 branch of Zope Interfaces here and announced here.
Use python 2.x. It is more supported by most libraries. It has many 3.x features plus all 3rd party libraries. Later when dependencies are available you can migrate to py3 using 2to3.

What's the state-of-the-art in Python programming in Windows? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking to set up my development environment at home for writing Windows applications in Python.
For my first piece, I'm writing a simple, forms-based application that stores data input as XML (and can read that information back.) I do want to set up the tools I'd use professionally, though, having already done a round of didactic programming.
What tools are professional python developers using these days? In order to have a working python environment, what version of the compiler should I be using? What editor is common for professionals? What libraries are considered a must-have for every serious python developer?
Specifically, which Windowing and XML libraries are de rigeur for working in Windows?
I like Eclipse + PyDev (with extensions).
It is available on Windows, and it works very well well. However, there are many other IDEs, with strengths and weakness.
As for the interpreter (Python is interpreted, not compiled!), you have three main choices: CPython, IronPython and Jython.
When people say "Python" they usually refer to "CPython" that is the reference implementation, but the other two (based, respectively, on .Net and Java) are full pythons as well :-)
In your case, I would maybe go on IronPython, because it will allow you to leverage your knowledge of .Net to build the GUI and treating the XML, while leaving the implementation of business logic to Python.
Finally, should you decide to use CPython, finally, there are several choices for working with xml:
minidom; included in the standard library
lxml, faster and with a better API; it means an additional installation on top of Python.
Lots of questions, most hard to answer correctly. First of all, most of python development happens on unix-like platforms. You will hit many walls during development on Windows box.
Python is not a compiled lanugage, current preferred version for production is 2.5. For environement setup you should take a look at virtualenv. Editor is a personal choice, many Python developers use Vim, you can customize it pretty well to suite your needs.
About libraries, Python is very strong around this area and it's really hard to say what is a must to know. If you want to handle XML, I would preffer lxml.
If you go for CPython, make sure you get the win32 extensions by Mark Hammond, either as a separate download which you install on top of the vanilla Python installation, or as part of ActiveState's ActivePython. It includes an integrated editor and debugger.
Jython has recently reached 2.5 compliancy, but we quickly ran into recursion limit issues.
The standard distribution includes IDLE, a graphical editor and debugger.
I like shells, so I'm using IPython for interactive work, and pydb as debugger (unfortunately, I had problems getting pydb to work under Windows).
"What tools are professional python developers using these days?"
Lots
"In order to have a working python environment, what version of the compiler should I be using?"
["compiler" is meaningless. I'll assume you mean "Python"]
We use 2.5.4. We'll be upgrading to 2.6 as soon as we've done the testing.
"What editor is common for professionals?"
We use Komodo Edit.
"What libraries are considered a must-have for every serious python developer?"
We use Django, XLRD, PIL, and a few others. We don't plan this kind of thing in advance. As our requirements arrive, we start looking for libraries. We don't "pre-load" a bunch of "must-have" libraries. The very idea is silly. We load what we need to solve the problems we have.
There are no set standards in these matters, and for good reasons:
there is a fair amount of good choice
different people are productive with different tools
different tools and libraries are suited for solving different problems
That said, I think it's a valid question exactly because there is a fair amount of good choice. When there is too much choice people often do not chose at all and move on. You still need to do your own research to decide what is best for you but you may find here some good starting points.
Here is what I use professionally on windows:
python 2.5.4
latest wxPython
XRC Resource Editor from the wxPython docs & demos for the grunt of the tedious GUI design
lxml or gnosis utils for xml
WingIDE Professional
Taking the headline question literally, the answer has to be IronPython. The 2.0 releases are equivalent to CPython 2.5, and the 2.6 release (currently at beta2) is intended to match CPython 2.6 (full 2.6 release some time in the next couple of months). With either you can use the state of the art in Windows GUI frameworks, i.e. WPF; and you get the whole .net XML support libraries (excepting Linq to XML, which relies on clever bits of C# that IronPython cannot yet emulate).
I've used NetBeans Python plug-in happily as an IDE for IronPython using WPF.
The answer would depend on what you want to do with Python. If you want to do web programming, Python is blessed with many web frameworks. The most popular ones are: Django, Pylons, and Turbogears. There's also Google App Engine, where you can deploy your Python webapp (based on GAE framework) to Google's infrastructure. If you want to do Desktop programming then there is PyQT and TkInter, or you can even try using Java Swing with Jython. And if you want to do Mobile app programming then there is Python for S60 which is backed by Nokia.
Python is interpreted language, so there is no compiler (although the interpreter also compiles your python module into bytecode). I would recommend using Python 2.6 as it has some syntax and libraries that is different compared to 2.5. You can also start learning Python 3.0 too.
There is several IDE that is good for Python. You don't have to get yourself attached into one editor/IDE because most of them are good ones. For the commercial ones there is WingIDE which is really focus on making IDE for Python and I would really recommend IntelliJ IDEA with Python plugin which is really nice if you often look at the libraries in your Python environment. For the free ones (as others have said) there is Komodo Edit or you can also try Netbeans with Python plugin.
As for the must-have libraries, this is depending on what you want to do. What kind of application you want to develop with Python. But I think every Python developer should consider PIL for imaging library. I also use simplejson quite often, because I prefer using JSON rather than XML. If you are using XML though, you can use lxml as it is really fast in parsing XML.

Categories