Skip to content

Commit bebd247

Browse files
committed
Add a few examples
1 parent 79b96e3 commit bebd247

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

examples/ls.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from __future__ import print_function
2+
import command
3+
4+
response = command.run(['ls')])
5+
print("\nOutput:")
6+
print(response.output)
7+
print("\nReturn Code:")
8+
print(response.exit)

examples/sleep.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from __future__ import print_function
2+
import time
3+
print("start")
4+
time.sleep(5)
5+
print("stop")

examples/sleep_debug.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from __future__ import print_function
2+
import command
3+
import os.path
4+
import logging
5+
logging.basicConfig(level=logging.DEBUG, format='%(message)s')
6+
7+
print("Go go gadget")
8+
response = command.run(['python', os.path.join(os.path.dirname(__file__), 'sleep.py')], debug=logging.debug)
9+
print("\nOutput:")
10+
print(response.output)
11+
print("\nReturn Code:")
12+
print(response.exit)

0 commit comments

Comments
 (0)