i'm trying to save output of a python code that actually it has written with os.system
import os
os.system("sudo nmap -p5433 -P0 -oG - -sS 127.0.0.1 | \
sed -n 's/.* \([0-9\.]\{7,\}\).*\/open\/.*/\1/p' > result.txt")
As you can see at the end of a line,output should be save in "result.txt" and i'm sure the output should be an ip (127.0.0.1) but the output is something like this:
the output is a symbol or something like that,is there any way that i can save the output of this code correctly?