102
❘
CHAPTER 6
Using the Python standard Library
4.
Click the down arrow in the Register Extensions option and choose Entire Feature Will Be
Unavailable from the menu. You can choose to keep all of the remaining features if desired
(highly recommended).
5.
Configure any of the other installation options as needed. Click Next. You’ll see a status dialog
box as Python installs to your hard drive. Eventually, you see a completion dialog box.
6.
Click Finish. Python (and its associated Standard Library) is set up on your machine.
C ModuLEs In THE PyTHon sTAndARd LIbRARy
One of the reasons that IronPython installs a tuned version of the Standard Library
is that the full Standard Library has modules written in C included with it. These
modules generally won’t work with IronPython. As Python has become more
advanced, the developers have removed many of these C modules and you may
eventually find that they’re all gone.
Of course, you might find that you really do need that C module because nothing else
will work. In this case, you can try to gain access to the C module using IronClad
(
http://code.google.com/p/ironclad/
). You won’t always have complete success
using IronClad, but it does help considerably, and you should give it a try for those
stubborn modules.
Another potential fix is getting a pure Python version of the module you need from
PyPy (
http://codespeak.net/pypy/dist/pypy/doc/
). In many cases, the PyPy
solution is actually a little more compatible than other solutions because it does rely
on pure Python code to provide access to the module you want. A potential disad-
vantage of this solution is that the pure Python alternatives will tend to run slower
than the C modules they replace.
Finally, there’s the IronPython Community Edition (also known as FePy) (
http://
fepy.sourceforge.net/
). This group has created solutions for the C modules
based on the .NET Framework. From an IronPython perspective, this solution is
probably the most compatible option. However, in using the .NET Framework, you
potentially give up some cross-platform independence. Fortunately, the IronPython
Community Edition also has information on using its version of IronPython with
Mono (
http://mono-project.com/Main_Page
), which lets .NET applications run
on both Linux and Macintosh systems.
Do'stlaringiz bilan baham: |