mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Better example for os.system(): do not change the system time.
This commit is contained in:
parent
326c57d1d9
commit
fe12390b45
1 changed files with 3 additions and 3 deletions
|
@ -14,11 +14,11 @@ The :mod:`os` module provides dozens of functions for interacting with the
|
|||
operating system::
|
||||
|
||||
>>> import os
|
||||
>>> os.system('time 0:02')
|
||||
0
|
||||
>>> os.getcwd() # Return the current working directory
|
||||
'C:\\Python31'
|
||||
>>> os.chdir('/server/accesslogs')
|
||||
>>> os.chdir('/server/accesslogs') # Change current working directory
|
||||
>>> os.system('mkdir today') # Run the command mkdir in the system shell
|
||||
0
|
||||
|
||||
Be sure to use the ``import os`` style instead of ``from os import *``. This
|
||||
will keep :func:`os.open` from shadowing the built-in :func:`open` function which
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue