Commit fe12390b authored by Georg Brandl's avatar Georg Brandl

Better example for os.system(): do not change the system time.

parent 326c57d1
...@@ -14,11 +14,11 @@ The :mod:`os` module provides dozens of functions for interacting with the ...@@ -14,11 +14,11 @@ The :mod:`os` module provides dozens of functions for interacting with the
operating system:: operating system::
>>> import os >>> import os
>>> os.system('time 0:02')
0
>>> os.getcwd() # Return the current working directory >>> os.getcwd() # Return the current working directory
'C:\\Python31' '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 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 will keep :func:`os.open` from shadowing the built-in :func:`open` function which
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment