Changeset 20
- Timestamp:
- 23/06/09 10:20:11 (4 years ago)
- File:
-
- 1 edited
-
trunk/traducidos/modules.rst (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/traducidos/modules.rst
r19 r20 245 245 .. _tut-standardmodules: 246 246 247 Standard Modules 247 Módulos estándar 248 248 ================ 249 249 250 250 .. index:: module: sys 251 251 252 Python comes with a library of standard modules, described in a separate 253 document, the Python Library Reference ("Library Reference" hereafter). Some 254 modules are built into the interpreter; these provide access to operations that 255 are not part of the core of the language but are nevertheless built in, either 256 for efficiency or to provide access to operating system primitives such as 257 system calls. The set of such modules is a configuration option which also 258 depends on the underlying platform For example, the :mod:`winreg` module is only 259 provided on Windows systems. One particular module deserves some attention: 260 :mod:`sys`, which is built into every Python interpreter. The variables 261 ``sys.ps1`` and ``sys.ps2`` define the strings used as primary and secondary 262 prompts:: 252 Python viene con una biblioteca de módulos estándar, descrita en un documento 253 separado, la Referencia de la Biblioteca de Python (de aquí en más, "Referencia 254 de la Biblioteca"). Algunos módulos se integran en el intérprete; estos 255 proveen acceso a operaciones que no son parte del núcleo del lenguaje pero que 256 sin embargo están integrados, tanto por eficiencia como para proveer acceso a 257 primitivas del sistema operativo, como llamadas al sistema. El conjunto de 258 tales módulos es una opción de configuración el cual también depende de la 259 plataforma subyacente. Por ejemplo, el módulo :mod:`winreg` sólo se provee 260 en sistemas Windows. Un módulo en particular merece algo de atención: 261 :mod:`sys`, el que está integrado en todos los intérpretes de Python. Las 262 variables ``sys.ps1`` y ``sys.ps2`` definen las cadenas usadas como cursores 263 primarios y secundarios:: 263 264 264 265 >>> import sys … … 273 274 274 275 275 These two variables are only defined if the interpreter is in interactive mode.276 277 The variable ``sys.path`` is a list of strings that determines the interpreter's 278 search path for modules. It is initialized to a default path taken from the 279 environment variable :envvar:`PYTHONPATH`, or from a built-in default if 280 :envvar:`PYTHONPATH` is not set. You can modify it using standard list 281 operations::276 Estas dos variables están solamente definidas si el intérprete está en modo interactivo. 277 278 La variable ``sys.path`` es una lista de cadenas que determinan el camino de 279 búsqueda del intérprete para los módulos. Se inicializa por omisión a un 280 camino tomado de la variable de entorno :envvar:`PYTHONPATH`, o a un valor 281 predefinido en el intérprete si :envvar:`PYTHONPATH` no está configurada. Lo 282 podés modificar usando las operaciones estándar de listas:: 282 283 283 284 >>> import sys
Note: See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/python-tutorial/chrome/site/your_project_logo.png)