Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3fc9d73

Browse files
committed
new version
1 parent ffa257d commit 3fc9d73

1 file changed

Lines changed: 103 additions & 57 deletions

File tree

Misc/FAQ

Lines changed: 103 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ Newsgroups: comp.lang.python,comp.answers,news.answers
33
Followup-to: comp.lang.python
44
From: [email protected] (Guido van Rossum)
55
Reply-to: [email protected] (Guido van Rossum)
6-
Expires: Sat, 1 Jul 1995 00:00:00 GMT
7-
Supersedes: <D6uD1L.BLv@cwi.nl>
6+
Expires: Fri, 1 Sep 1995 00:00:00 GMT
7+
Supersedes: <D9G7ow.IDL@cwi.nl>
88
99

1010
Archive-name: python-faq/part1
1111
Submitted-by: Guido van Rossum <[email protected]>
12-
Version: 1.24
13-
Last-modified: 31 May 1995
12+
Version: 1.25
13+
Last-modified: 25 July 1995
1414

1515
This article contains answers to Frequently Asked Questions about
1616
Python (an object-oriented interpreted programming language -- see
@@ -108,6 +108,8 @@ Here's an overview of the questions per chapter:
108108
3.11. Q. Trouble with posix.listdir on NeXTSTEP 3.2.
109109
3.12. Q. Other trouble building Python on platform X.
110110
3.13. Q. How to configure dynamic loading on Lixux.
111+
3.14. Q. Under Solaris 2.x, using GCC, how do I use shared libraries?
112+
3.15. Q. Errors when linking with a shared library containing C++ code.
111113

112114
4. Programming in Python
113115
4.1. Q. Is there a source code level debugger with breakpoints, step,
@@ -299,9 +301,11 @@ distribution:
299301
<URL:ftp://ftp.wustl.edu/graphics/graphics/sgi-stuff/python/>
300302
<URL:ftp://ftp.funet.fi/pub/languages/python/>
301303
<URL:ftp://ftp.sunet.se/pub/lang/python/>
302-
<URL:ftp://unix.hensa.ac.uk/uunet/languages/python/>
303-
<URL:ftp://ftp.sterlng.com/programming/languages/python/>
304-
<URL:ftp://ftp.ibp.fr/pub/python/>
304+
<URL:ftp://unix.hensa.ac.uk/mirrors/uunet/languages/python/>
305+
<URL:ftp://ftp.sterling.com/programming/languages/python/>
306+
<URL:ftp://ftp.ibp.fr/pub/python/>
307+
<URL:ftp://ftp.switch.ch/software/sources/python/>
308+
<URL:ftp://ftp.informatik.tu-muenchen.de/pub/comp/programming/languages/python/>
305309

306310
Or try archie on the string "python".
307311

@@ -344,9 +348,9 @@ ftp, e.g. <URL:ftp://ftp.python.org/pub/python/doc/lib-info.tar.gz>.
344348

345349
1.9. Q. Is there a book on Python, or will there be one out soon?
346350

347-
A. I am writing one. Publishers are interested. Optimistically, it
348-
will be ready for the press by mid-1995. Mark Lutz is working on one
349-
too -- more details as they emerge.
351+
A. Mark Lutz is writing a Python book for O'Reilly and Associates, to
352+
be published early 1996. See the outline (in PostScript):
353+
<URL:http://www.python.org/workshops/1995-05/outlinep.eps>.
350354

351355
1.10. Q. Are there any published articles about Python that I can quote?
352356

@@ -714,15 +718,13 @@ HAVE_PROTOTYPES.
714718

715719
3.11. Q. Trouble with posix.listdir on NeXTSTEP 3.2.
716720

717-
A. (This is fixed in 1.2.) You need to pass "-posix" to the C
718-
compiler, especially in the link phase -- it uses the correct version
719-
of the C library. The easiest way is perhaps to do "make OPT=-posix".
720-
You also need to remove this NeXT-specific section from import.c:
721+
A. (This often manifests itself as a weird error from the
722+
compileall.py script run by "make libinstall".)
721723

722-
#if defined(NeXT) || defined(WITH_RLD)
723-
#define DYNAMIC_LINK
724-
#define USE_RLD
725-
#endif
724+
Don't use gcc, use the Next C compiler (cc). Even though it is
725+
derived from (an old version of) gcc, its interpretation of the
726+
"-posix" switch is different; in this particular case, cc is right and
727+
gcc is wrong.
726728

727729
3.12. Q. Other trouble building Python on platform X.
728730

@@ -735,37 +737,62 @@ to me too.
735737

736738
3.13. Q. How to configure dynamic loading on Lixux.
737739

738-
A. (Thanks to Andrew Kuchling):
740+
A. There are two answers, depending on whether you are using the new
741+
ELF object format or not.
739742

740-
Linux requires that you use the GNU DLD library. The stages of using
741-
dynamic libraries on Linux are:
743+
For ELF, this seems to be the procedure (thanks to Martin von Loewis):
742744

743-
1) Get dld 3.2.5 from a Linux site. Be careful here; the most recent
744-
GNU version is 3.2.3, and doesn't support Linux; be sure to get it
745-
from a Linux mirror, not a GNU mirror (3.2.4 should also work).
746-
Compile it and install the library libdld.a somewhere; I used
747-
/usr/local/lib.
745+
Compile Python to an ELF binary.
748746

749-
Suitable URLs for the dld distribution are currently:
750-
<URL:ftp://sunsite.unc.edu/pub/Linux/libs/dld-3.2.5.src.tar.gz> and
751-
<URL:ftp://tsx-11.mit.edu/pub/linux/sources/libs/dld-3.2.5.src.tar.gz>.
752-
There's also a binary distribution of it:
753-
<URL:ftp://sunsite.unc.edu/pub/Linux/libs/dld-3.2.5.bin.tar.gz>.
747+
In addition, you have to use the following flags:
754748

755-
2) Get Jack Jansen's DL library; its location is given in the
756-
_Extending Python_ manual as <URL:ftp://ftp.cwi.nl/pub/dynload/>.
757-
Compile it and install libdl.a wherever you put libdld.a.
749+
- when linking python: -rdynamic -ldl
750+
- when compiling an object that goes into a shared module: -fPIC
751+
- when linking a shared module: -shared -ldl
758752

759-
3) Run Python's configure script, giving it the --with-dl-dld option,
760-
which requires a parameter giving the directory where you put the
761-
libraries.
753+
Furthermore, it appears that some Python releases did not understand
754+
that Linux has dynamic linking. Python 1.2 did it right, but you
755+
should check wether the generated config.h indicates the use of -ldl
756+
(i.e. dlopen, dlsym). Finally, you can load a shared module by saying
757+
'use foo'. Make sure the module is in your PYTHONPATH.
762758

763-
4) Recompile Python.
759+
For pre-ELF systems (thanks to Andrew Kuchling):
764760

765-
Note that once ELF is common in the Linux world, it will be much
766-
easier (probably within a year) -- the standard SVR4-style dlopen()
767-
interface is then available. This has already proved to work
768-
perfectly using a beta version of the ELF-capable GCC for Linux.
761+
Pre-ELF Linux requires that you use the GNU DLD library. The stages
762+
of using dynamic libraries on Linux are:
763+
764+
1) Get dld 3.2.5 from a Linux site. Be careful here; the most
765+
recent GNU version is 3.2.3, and doesn't support Linux; be sure to
766+
get it from a Linux mirror, not a GNU mirror (3.2.4 should also
767+
work). Compile it and install the library libdld.a somewhere; I
768+
used /usr/local/lib.
769+
770+
Suitable URLs for the dld distribution are currently:
771+
<URL:ftp://sunsite.unc.edu/pub/Linux/libs/dld-3.2.5.src.tar.gz> and
772+
<URL:ftp://tsx-11.mit.edu/pub/linux/sources/libs/dld-3.2.5.src.tar.gz>.
773+
There's also a binary distribution of it:
774+
<URL:ftp://sunsite.unc.edu/pub/Linux/libs/dld-3.2.5.bin.tar.gz>.
775+
776+
2) Get Jack Jansen's DL library; its location is given in the
777+
_Extending Python_ manual as <URL:ftp://ftp.cwi.nl/pub/dynload/>.
778+
Compile it and install libdl.a wherever you put libdld.a.
779+
780+
3) Run Python's configure script, giving it the --with-dl-dld option,
781+
which requires a parameter giving the directory where you put the
782+
libraries.
783+
784+
4) Recompile Python.
785+
786+
3.14. Q. Under Solaris 2.x, using GCC, how do I use shared libraries?
787+
788+
A. Use the linker in /usr/ucb/ld, not the GNU linker. The latter
789+
cannot create shared libraries.
790+
791+
3.15. Q. Errors when linking with a shared library containing C++ code.
792+
793+
A. Link the main Python binary with C++. Change the definition of
794+
LINKCC in Modules/Makefile to be your C++ compiler. You may have to
795+
edit config.c slightly to make it compilable with C++.
769796

770797

771798
4. Programming in Python
@@ -1054,6 +1081,12 @@ preserves the look and feel of the underlying graphics toolkit. See
10541081
the wxPython WWW page at
10551082
<URL:http://www.aiai.ed.ac.uk/~jacs/wx/wxpython/wxpython.html>.
10561083

1084+
- There's an object-oriented GUI based on the Microsoft Foundation
1085+
Classes model called WPY. Programs written in WPY run unchanged and
1086+
with native look and feel on NT, Windows 3.1 (using win32s) and on
1087+
Unix (using Tk). Source and binaries for NT and Linux are available
1088+
in <URL:ftp://ftp.python.org/pub/python/wpy>.
1089+
10571090
- Python has been mentioned on the "Futurism" subpage of the Fresco
10581091
home page <URL:http://www.faslab.com/fresco/HomePage.html>. "Pesto"
10591092
is a Python interface to the CORBA dynamic invocation interface, and
@@ -1371,8 +1404,12 @@ Note that many interactive programs (e.g. vi) don't work well with
13711404
pipes substituted for standard input and output. You will have to use
13721405
pseudo ttys ("ptys") instead of pipes. There is some undocumented
13731406
code to use these in the library module pty.py -- I'm afraid you're on
1374-
your own here. What's *really* needed is a Python interface to Don
1375-
Libes' expect library -- any takers?
1407+
your own here.
1408+
1409+
A different answer is a Python interface to Don Libes' "expect"
1410+
library. A prerelease of this is available on the Python ftp mirror
1411+
sites in the contrib subdirectory as expy-0.3.tar.gz, e.g.
1412+
<URL:ftp://ftp.python.org/pub/python/contrib/expy-0.3.tar.gz>.
13761413

13771414
4.31. Q. How do I call a function if I have the arguments in a tuple?
13781415

@@ -1786,16 +1823,23 @@ e.g. <URL:ftp://ftp.python.org/pub/python/pc/>.
17861823
7.3. Q. Is there a Windows 3.1(1) version of Python?
17871824

17881825
A. Yes, also see the "pc" subdirectory of the distribution sites,
1789-
e.g. <URL:ftp://ftp.python.org/pub/python/pc/>.
1826+
e.g. <URL:ftp://ftp.python.org/pub/python/pc/>. You may also be able
1827+
to run either of the Windows NT versions (see next question) if you
1828+
have Microsoft's "win32s".
17901829

17911830
7.4. Q. Is there a Windows NT version of Python?
17921831

1793-
A. Yes. Mark Hammond <[email protected]> has built a full NT
1794-
port. This supports using DLLs for dynamic loading of Python modules,
1795-
and includes an interface to the Microsoft Foundation Classes and a
1796-
Python programming environment using it that's written mostly in
1797-
Python. See <URL:ftp://ftp.python.org/pub/python/nt/> -- most mirrors
1798-
will also have this.
1832+
A. There are two, both sporting DLL support for dynamic loading of
1833+
Python modules, and extensions to access the Win32 GUI API.
1834+
1835+
Mark Hammond <[email protected]> maintains an NT port which
1836+
includes an interface to the Microsoft Foundation Classes and a Python
1837+
programming environment using it that's written mostly in Python. See
1838+
<URL:ftp://ftp.python.org/pub/python/nt/>.
1839+
1840+
Jim Ahlstrom's WPY portable GUI runs on Windows NT and is modeled
1841+
after the Microsoft Foundation Classes. Source and binaries are
1842+
available in <URL:ftp://ftp.python.org/pub/python/wpy>.
17991843

18001844
Sam Rushing <[email protected]> once announced he knows how to
18011845
build Python for the Windows NT on the DEC Alpha AXP.
@@ -1806,7 +1850,7 @@ of Visual C++ 2.0.
18061850

18071851
7.5. Q. Is there a Windows 95 version of Python?
18081852

1809-
A. The Windows NT version might work, otherwise the Windows 3.1(1)
1853+
A. The Windows NT versions might work, otherwise the Windows 3.1(1)
18101854
version should work (isn't Windows 95 supposed to be backwards
18111855
compatible?).
18121856

@@ -1817,13 +1861,15 @@ e.g. <URL:ftp://ftp.python.org/pub/python/pc/>.
18171861

18181862
7.7. Q. Is there a VMS version of Python?
18191863

1820-
A. I think not. This question has been asked on the list several
1821-
times and I've never seen an affirmative answer.
1864+
A. Donn Cave <[email protected]> did a partial port. The
1865+
results of his efforts are on public display in
1866+
<<URL:ftp://ftp.python.org/pub/python/contrib/vms.tar.gz/>.
18221867

1823-
7.8. Q. What about IBM mainframes, or other esoteric non-UNIX
1824-
platforms?
1868+
7.8. Q. What about IBM mainframes, or other non-UNIX platforms?
18251869

1826-
A. Basically, the same story as for VMS...
1870+
A. I haven't heard about these, except I remember once hearing about
1871+
an attempt at an OS/9 port. If you're interested in any of this, go
1872+
directly to the newsgroup and ask there, who knows what you may find.
18271873

18281874
7.9. Q. Where are the source or Makefiles for the non-UNIX versions?
18291875

0 commit comments

Comments
 (0)