> For the complete documentation index, see [llms.txt](https://notes.myhackingblog.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.myhackingblog.com/misc-1/python-subprocess-getoutput.md).

# Python subprocess getoutput

This has been tested in python flask debug environments and should work in situations where new line characters are not being properly interpretted by the standard python subprcess getoutput function.<br>

```
def run(cmd): from subprocess import getoutput;x=getoutput(cmd);print(x,end='\n')
```

<figure><img src="/files/zGx533CbwDXd33FeV12g" alt=""><figcaption></figcaption></figure>
