I am very new to python. I am trying to simulate cat < file.txt in my python script but it is throwing an error.

```
import os, sys, time

f = open('file.txt' , "r")  # just hello world written in it. 

default_stdin = os.dup(sys.stdin.fileno())

os.dup2(f.fileno(), sys.stdin.fileno())

i = input()

print(i)  # so i is = 'hello world'

pid = os.fork()

if pid == 0:

    os.execl('/bin/cat','cat', i )

    os.exit()

elif pid > 0:

    os.wait()

os.dup2(default_stdin, sys.stdin.fileno())

f.close()

```

I am passing the read output of input ('Hello world') and it is showing this error:

```
cat: 'Hello world.': No such file or directory

```

**I think it is because you have to provide a file name as an argument not a string. 
if that is the case how do i use the read standard input with cat command? (cat < file.txt)**

*very limited on resources, Cant use os.popen() or os.subprocess().*

Thanks