Python: TypeError: coercing to Unicode: need string or buffer, module found
<p>I am new to Python, just learning.</p>

<p>I am taking one of the file as input and I want to print the text on the console using python.</p>

<pre><code># This will take the file as input

import fileinput
for line in fileinput.input():

    print "The file name you provided is " + fileinput.filename()

    #file of = open(fileinput, "r", 0)
    with open(fileinput,'r') as myfile:
        data=myfile.read()
        print "This is your actual data \n\n" + data
</code></pre>

<p>The error I'm experiencing is:</p>

<pre><code>TypeError: coercing to Unicode: need string or buffer, module found
</code></pre>

<p>Could any one please help me out on this please.</p>