[Python-checkins] r86801 - python/branches/py3k/Doc/tutorial/stdlib.rst
georg.brandl
python-checkins at python.org
Fri Nov 26 13:12:14 CET 2010
Author: georg.brandl
Date: Fri Nov 26 13:12:14 2010
New Revision: 86801
Log:
Better example for os.system(): do not change the system time.
Modified:
python/branches/py3k/Doc/tutorial/stdlib.rst
Modified: python/branches/py3k/Doc/tutorial/stdlib.rst
==============================================================================
--- python/branches/py3k/Doc/tutorial/stdlib.rst (original)
+++ python/branches/py3k/Doc/tutorial/stdlib.rst Fri Nov 26 13:12:14 2010
@@ -14,11 +14,11 @@
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
More information about the Python-checkins
mailing list