Mercurial > hgrepos > Python > libs > ConfigMix
comparison docs/introduction.rst @ 697:57fe110c50c8
Implement a new "SYS" namespace with "prefix", "base_prefix" and "platform"
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 14 Jun 2023 01:11:01 +0200 |
| parents | 3062b63325c4 |
| children | 3a9d661d33b5 |
comparison
equal
deleted
inserted
replaced
| 696:8648e0641d60 | 697:57fe110c50c8 |
|---|---|
| 370 | 370 |
| 371 ``node`` | 371 ``node`` |
| 372 Contains the current node's computername (or whatever | 372 Contains the current node's computername (or whatever |
| 373 :py:func:`platform.node` returns) | 373 :py:func:`platform.node` returns) |
| 374 | 374 |
| 375 4. The namespace ``ENV`` | 375 4. The namespace ``SYS`` |
| 376 | |
| 377 Available functions: | |
| 378 | |
| 379 ``prefix`` | |
| 380 Contains the content of the current running Python's | |
| 381 :py:data:`sys.prefix`. | |
| 382 | |
| 383 ``base_prefix`` | |
| 384 Contains the content of the current running Python's | |
| 385 :py:data:`sys.base_prefix`. | |
| 386 | |
| 387 Raises :py:class:`KeyError` if the attribute is not available. | |
| 388 | |
| 389 ``platform`` | |
| 390 Contains the content of the current running Python's | |
| 391 :py:data:`sys.platform`. | |
| 392 | |
| 393 5. The namespace ``ENV`` | |
| 376 | 394 |
| 377 This namespace contains all the environment variables as they are | 395 This namespace contains all the environment variables as they are |
| 378 available from :py:data:`os.environ`. | 396 available from :py:data:`os.environ`. |
| 379 | 397 |
| 380 5. The namespace ``PY`` | 398 6. The namespace ``PY`` |
| 381 | 399 |
| 382 Contains selected values from the running Python: | 400 Contains selected values from the running Python: |
| 383 | 401 |
| 384 ``version`` | 402 ``version`` |
| 385 The return value of :py:func:`platform.python_version` | 403 The return value of :py:func:`platform.python_version` |
| 392 Just the major version of the running Python | 410 Just the major version of the running Python |
| 393 | 411 |
| 394 ``implementation`` | 412 ``implementation`` |
| 395 The return value of :py:func:`platform.python_implementation` | 413 The return value of :py:func:`platform.python_implementation` |
| 396 | 414 |
| 397 6. The namespace ``AWS`` | 415 7. The namespace ``AWS`` |
| 398 | 416 |
| 399 Contains some metadata for AWS instances when running from within | 417 Contains some metadata for AWS instances when running from within |
| 400 AWS: | 418 AWS: |
| 401 | 419 |
| 402 ``metadata.instance-id`` | 420 ``metadata.instance-id`` |
