I'm trying to run a CLI tool using
Код: Выделить всё
subprocess.run()Folder structure
Код: Выделить всё
script.py mytools |__tool_x |__tool_y Код: Выделить всё
import os import subprocess command = ["mytools/tool_x", "--help"] subprocess.run( command, stdout=subprocess.DEVNULL, cwd=os.path.dirname(__file__), ) Case-2:
Код: Выделить всё
import os import subprocess command = ["mytools/tool_x", "--subcommand", "test", "--subarg"] subprocess.run( command, stdout=subprocess.DEVNULL, cwd=os.path.dirname(__file__), ) Код: Выделить всё
FileNotFoundError: [Errno 2] No such file or directory: 'mytools/tool_x'"How can i resolve this, not able to find the issue, generally what are the possibilities for this issue?
Источник: https://stackoverflow.com/questions/781 ... subprocess