Hi i have this issue i am executing a shell command in my python script and the probleme i am getting two results instead of 1. The first is the id that i want to store the second is a 0 and i guess its the result code.
This is my code
import os
cmd = "/path/to/ctl so list | tail -1 | awk '{print $1}'"
event_id = os.system(cmd)
print(event_id)
and this is the result:
225
0
how can i delete that 0.
Thanks
os.system()intoevent_id; that is0. The output of the command you ran showed up as well. Did you intend to capture the output of the command intoevent_id?