~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Doc/library/dl.rst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-04-08 02:29:05 UTC
  • mto: (10.1.3 experimental)
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: james.westby@ubuntu.com-20090408022905-xa5zbe8821m2o77o
Tags: upstream-2.6.2~rc1
ImportĀ upstreamĀ versionĀ 2.6.2~rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
   :platform: Unix
7
7
   :synopsis: Call C functions in shared objects.
8
8
   :deprecated:
9
 
   
 
9
 
10
10
.. deprecated:: 2.6
11
11
    The :mod:`dl` module has been removed in Python 3.0. Use the :mod:`ctypes`
12
12
    module instead.
13
 
   
 
13
 
14
14
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
15
15
 
16
16
The :mod:`dl` module defines an interface to the :cfunc:`dlopen` function, which
91
91
   Return the pointer for the function named *name*, as a number, if it exists in
92
92
   the referenced shared object, otherwise ``None``. This is useful in code like::
93
93
 
94
 
      >>> if a.sym('time'): 
 
94
      >>> if a.sym('time'):
95
95
      ...     a.call('time')
96
 
      ... else: 
 
96
      ... else:
97
97
      ...     time.time()
98
98
 
99
99
   (Note that this function will return a non-zero number, as zero is the *NULL*