I am quite new in 'subprocess' function and wanna to read the output of the command run within python code.
It seems that no problem arose when I line by line ran my code unter python, but when I ran it in bash by typing 'python test.py' (test.py is where my code was packed) it ended up with only b''
and results from 'head' command however were not showed.
import subprocess
pro = subprocess.Popen("sed 's/A/N/g *.txt | head Quelle1.txt'", shell=True,stdout=subprocess.PIPE)
content = pro.stdout.readlines()
for line in content:
print(list)
any help would be appreciated!!!