]> granicus.if.org Git - python/commitdiff
Better example for os.system(): do not change the system time.
authorGeorg Brandl <georg@python.org>
Fri, 26 Nov 2010 12:12:14 +0000 (12:12 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 26 Nov 2010 12:12:14 +0000 (12:12 +0000)
Doc/tutorial/stdlib.rst

index 61e1a451eb82414da013b3d2b02e4f9b8112857f..9d25dbd9b74935d2cb5d905c00f9e566be03d455 100644 (file)
@@ -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