MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / execute_command

Function execute_command

bsp/w60x/makeimg.py:27–41  ·  view source on GitHub ↗

Execute the system command at the specified address.

(cmdstring, cwd=None, shell=True)

Source from the content-addressed store, hash-verified

25makeimg_new_fls='.'
26
27def execute_command(cmdstring, cwd=None, shell=True):
28 """Execute the system command at the specified address."""
29
30 if shell:
31 cmdstring_list = cmdstring
32
33 sub = subprocess.Popen(cmdstring_list, cwd=cwd, stdin=subprocess.PIPE,
34 stdout=subprocess.PIPE, shell=shell, bufsize=8192)
35
36 stdout_str = ""
37 while sub.poll() is None:
38 stdout_str += str(sub.stdout.read())
39 time.sleep(0.1)
40
41 return stdout_str
42
43def copy_file(name, path):
44 res = True

Callers 1

do_makeimgFunction · 0.85

Calls 2

sleepMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected