summaryrefslogtreecommitdiffstats
path: root/Doc/tutorial/stdlib.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-11-26 12:12:14 (GMT)
committerGeorg Brandl <georg@python.org>2010-11-26 12:12:14 (GMT)
commitfe12390b45ac5ac8080461d21e0471e4a690dc71 (patch)
tree2ef644bfd5e89740b40385ee18a5be54b068a3c2 /Doc/tutorial/stdlib.rst
parent326c57d1d918ff94a174821ffe6590c149054d1c (diff)
downloadcpython-fe12390b45ac5ac8080461d21e0471e4a690dc71.zip
cpython-fe12390b45ac5ac8080461d21e0471e4a690dc71.tar.gz
cpython-fe12390b45ac5ac8080461d21e0471e4a690dc71.tar.bz2
Better example for os.system(): do not change the system time.
Diffstat (limited to 'Doc/tutorial/stdlib.rst')
-rw-r--r--Doc/tutorial/stdlib.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/tutorial/stdlib.rst b/Doc/tutorial/stdlib.rst
index 61e1a45..9d25dbd 100644
--- a/Doc/tutorial/stdlib.rst
+++ b/Doc/tutorial/stdlib.rst
@@ -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