If we want the embedded language to open a file and use its contents for further processing, then follow this example. We have used the python3 way of opening and reading the contents of a file:
$ python3 -c "import sys, io; DATA = open('/home/student/sample.txt', 'r').read()" | sed -e "s|Hello|Bye|g" | less
In the preceding command-line code, the python3 command is opening and reading contents of a file. Then, it sends the content to the file to bash shell command sed by pipe. Sed replaces text Hello from file to Bye, and finally, it is displayed on screen by the less command.