Last change
on this file since 13397 was 13151, checked in by lusterma, 13 years ago |
added doc; this is just an example, nothing ready, to be adapted to work at ISDC, I just made this some time ago on my Laptop
|
File size:
407 bytes
|
Line | |
---|
1 | ========
|
---|
2 | Examples
|
---|
3 | ========
|
---|
4 |
|
---|
5 | calling a system command
|
---|
6 | ========================
|
---|
7 | Using the os module any command executable on the command line can be called within a script. This is in particular true for your own python scripts::
|
---|
8 |
|
---|
9 | import os
|
---|
10 | os.system('echo long listing of dir; pwd; ls -l')
|
---|
11 |
|
---|
12 | or suppose you created a script my_script.py::
|
---|
13 |
|
---|
14 | from os import system
|
---|
15 | system('python my_scrip.py')
|
---|
16 |
|
---|
17 |
|
---|
18 |
|
---|
19 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.