Skip to content

Commit

Permalink
add os
Browse files Browse the repository at this point in the history
Signed-off-by: chang-ning <spiderpower02@gmail.com>
  • Loading branch information
crazyguitar committed May 19, 2021
1 parent 934a72b commit d096f71
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Cheat Sheet
- `Typing <docs/notes/python-typing.rst>`_
- `Time <docs/notes/python-date.rst>`_
- `File <docs/notes/python-io.rst>`_
- `Operating System <docs/notes/python-os.rst>`_
Advanced Cheat Sheet
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ only includes basic Python features but also data structures and algorithms.
notes/python-typing
notes/python-date
notes/python-io
notes/python-os


Advanced Cheat Sheet
Expand Down
18 changes: 18 additions & 0 deletions docs/notes/python-os.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. meta::
:description lang=en: Collect useful snippets of Python
:keywords: Python, Python Cheat Sheet, Operating System

================
Operating System
================

.. contents:: Table of Contents
:backlinks: none

Get Number of CPUs
------------------

.. code-block:: python
>>> import os
>>> os.cpu_count()

0 comments on commit d096f71

Please sign in to comment.