I have a requirement where I need to extract port number from a file example.ini, this file is in linux directory.
Now when I am executing below command from CLI its giving exact result which I want
$ cat path/example.ini | grep -i variable | cut -d '=' -f 2
however I want run this command using python script using subprocess.run
I am executing in script
subprocess.run(['cat', 'path', '|', 'grep -i variable', '|', 'cut -d "=" -f2'])
I am getting error: No such file or directory
pathinstead ofpath/example.ini