Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit130491f

Browse files
hugovkdonBarbos
andauthored
[3.13]gh-130160: use.. program:: directive for documentingplatform CLI (GH-133335) (#133341)
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
1 parentc9c0beb commit130491f

File tree

2 files changed

+38
-9
lines changed

2 files changed

+38
-9
lines changed

‎Doc/library/cmdline.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The following modules have a command-line interface.
2828
*:mod:`pdb`
2929
*:mod:`pickle`
3030
*:ref:`pickletools<pickletools-cli>`
31-
*:mod:`platform`
31+
*:ref:`platform<platform-cli>`
3232
*:mod:`poplib`
3333
*:ref:`profile<profile-cli>`
3434
*:mod:`pstats`

‎Doc/library/platform.rst

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
section.
1818

1919

20-
CrossPlatform
20+
Crossplatform
2121
--------------
2222

2323

@@ -188,7 +188,7 @@ Cross Platform
188188
:attr:`processor` is resolved late instead of immediately.
189189

190190

191-
JavaPlatform
191+
Javaplatform
192192
-------------
193193

194194

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

208208

209-
WindowsPlatform
209+
Windowsplatform
210210
----------------
211211

212212

@@ -240,7 +240,7 @@ Windows Platform
240240
..versionadded::3.8
241241

242242

243-
macOSPlatform
243+
macOSplatform
244244
--------------
245245

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

255-
iOSPlatform
255+
iOSplatform
256256
------------
257257

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

273273

274-
UnixPlatforms
274+
Unixplatforms
275275
--------------
276276

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

289289

290-
LinuxPlatforms
290+
Linuxplatforms
291291
---------------
292292

293293
..function::freedesktop_os_release()
@@ -325,7 +325,7 @@ Linux Platforms
325325
..versionadded::3.10
326326

327327

328-
AndroidPlatform
328+
Androidplatform
329329
----------------
330330

331331
..function::android_ver(release="", api_level=0, manufacturer="", \
@@ -359,3 +359,32 @@ Android Platform
359359
<https://storage.googleapis.com/play_public/supported_devices.html>`__.
360360

361361
..versionadded::3.13
362+
363+
.. _platform-cli:
364+
365+
Command-line usage
366+
------------------
367+
368+
:mod:`platform` can also be invoked directly using the:option:`-m`
369+
switch of the interpreter::
370+
371+
python -m platform [--terse] [--nonaliased] [{nonaliased,terse} ...]
372+
373+
The following options are accepted:
374+
375+
..program::platform
376+
377+
..option::--terse
378+
379+
Print terse information about the platform. This is equivalent to
380+
calling:func:`platform.platform` with the *terse* argument set to ``True``.
381+
382+
..option::--nonaliased
383+
384+
Print platform information without system/OS name aliasing. This is
385+
equivalent to calling:func:`platform.platform` with the *aliased* argument
386+
set to ``True``.
387+
388+
You can also pass one or more positional arguments (``terse``, ``nonaliased``)
389+
to explicitly control the output format. These behave similarly to their
390+
corresponding options.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp