Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-130160: use .. program:: directive for documenting platform CLI #133335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2 Doc/library/cmdline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The following modules have a command-line interface.
* :mod:`pdb`
* :ref:`pickle <pickle-cli>`
* :ref:`pickletools <pickletools-cli>`
* :mod:`platform`
* :ref:`platform <platform-cli>`
* :mod:`poplib`
* :ref:`profile <profile-cli>`
* :mod:`pstats`
Expand Down
44 changes: 36 additions & 8 deletions 44 Doc/library/platform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
section.


Cross Platform
Cross platform
--------------


Expand Down Expand Up @@ -188,7 +188,7 @@ Cross Platform
:attr:`processor` is resolved late instead of immediately.


Java Platform
Java platform
-------------


Expand All @@ -206,7 +206,7 @@ Java Platform
and was only useful for Jython support.


Windows Platform
Windows platform
----------------


Expand Down Expand Up @@ -240,7 +240,7 @@ Windows Platform
.. versionadded:: 3.8


macOS Platform
macOS platform
--------------

.. function:: mac_ver(release='', versioninfo=('','',''), machine='')
Expand All @@ -252,7 +252,7 @@ macOS Platform
Entries which cannot be determined are set to ``''``. All tuple entries are
strings.

iOS Platform
iOS platform
------------

.. function:: ios_ver(system='', release='', model='', is_simulator=False)
Expand All @@ -271,7 +271,7 @@ iOS Platform
parameters.


Unix Platforms
Unix platforms
--------------

.. function:: libc_ver(executable=sys.executable, lib='', version='', chunksize=16384)
Expand All @@ -287,7 +287,7 @@ Unix Platforms
The file is read and scanned in chunks of *chunksize* bytes.


Linux Platforms
Linux platforms
---------------

.. function:: freedesktop_os_release()
Expand Down Expand Up @@ -325,7 +325,7 @@ Linux Platforms
.. versionadded:: 3.10


Android Platform
Android platform
----------------

.. function:: android_ver(release="", api_level=0, manufacturer="", \
Expand Down Expand Up @@ -360,6 +360,34 @@ Android Platform

.. versionadded:: 3.13

.. _platform-cli:

Command-line usage
------------------

:mod:`platform` can also be invoked directly using the :option:`-m`
switch of the interpreter::

python -m platform [--terse] [--nonaliased] [{nonaliased,terse} ...]

The following options are accepted:

.. program:: platform

.. option:: --terse

Print terse information about the platform. This is equivalent to
calling :func:`platform.platform` with the *terse* argument set to ``True``.

.. option:: --nonaliased

Print platform information without system/OS name aliasing. This is
equivalent to calling :func:`platform.platform` with the *aliased* argument
set to ``True``.

You can also pass one or more positional arguments (``terse``, ``nonaliased``)
to explicitly control the output format. These behave similarly to their
corresponding options.

Miscellaneous
-------------
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.