You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use osmosis in a python-script and I want to log the command output in my console.
This is the function I'm using to run osmosis:
def run_subprocess(command):
command_name = command.split()[0] # Get the name of the command
print(f"Running \033[1m{command_name}\033[0m with command:\n{command}\n")
process = subprocess.Popen(
command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True
)
output, error = process.communicate()
if output:
print(f"\033[1m{command_name}\033[0m output:\n", output.decode())
if error:
print(f"\033[1m{command_name}\033[0m Error:\n", error.decode())
normally communicate() returns a tuple (stdout, stderr) as is written in the description of the function but in my case even when I run the command successfully my stdout is empty and the stderr isn't.
If I do print(process.communicate()) I get:
I'm trying to use
osmosis
in a python-script and I want to log the command output in my console.This is the function I'm using to run
osmosis
:The command I'm inputting is:
normally
communicate() returns a tuple (stdout, stderr)
as is written in the description of the function but in my case even when I run the command successfully mystdout
is empty and thestderr
isn't.If I do
print(process.communicate())
I get:Therefore my commandline output reads:
is this a
osmosis
related issue?The text was updated successfully, but these errors were encountered: