Skip to content

Error using run() on Windows - for eg run("cmd /c dir") [fixed] #46

@ck81

Description

@ck81

Hi Ken,

Tried to run a DOS command using your suggestion in: aisingapore/TagUI#473

The following works in TagUI:

run cmd /c dir
echo run_result

In TagUI-Python on windows 10:

run_result = t.run("cmd /c dir")
print("run_result)

The above will give the error message:

Traceback (most recent call last):
  File "test1.py", line 2, in <module>
    run_result = t.run("cmd /c dir")
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tagui.py", line 1173, in run
    shell=True))
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'cmd /c dir; exit 0' returned non-zero exit status 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions