1

The code here is:

f = open('nametext','r')
print(f)
f.close()

but when I look at the print, there is not what I want:

<_io.TextIOWrapper name='nametext' mode='r' encoding='UTF-8'>

This is the message, but I want the text what it is in the file, like this:

Bevallás iparûzési adófeltöltési kötelezettségről 2013  
Gépjármûadó-kedvezmény mentesség bevallás 2013  
Helyi iparûzési adóbevallás 2013    
Idegenforgalmi adóbevallás 2013 
Kommunális adóbevallás 2013 
Talajterhelési díj bevallás 2013

What the problem is?

  • BTW, if the encoding isn't UTF-8 you need to mention that when opening the file, eg `f = open('nametext', 'r', encoding='latin2')` – PM 2Ring Aug 17 '18 at 12:52

1 Answers1

2

As was mentioned in the comments, you need to .read() the file:

with open('nametext','r') as f:
    print(f.read())
roryrjb
  • 789
  • 9
  • 11