Python 2.7 TypeError: 'file' object has no attribute '__getitem__'
Question: not sure why my statement is giving me this error. I am trying to open a file
that the user enters the path.

    
    
    import csv
    
    f = open(raw_input('Enter file path: '),'r')[1:-1]
    


Answer: This should be enough to open the file:

    
    
    f = open('workfile', 'w') 
    

If you want to read a part of the file you should let is read line by line
after is opened.  
You don't need the [1:-1]

    
    
    for line in f:
        print line
    

