how to read windows file in linux environment
Question: I'm trying to execute a python program on linux which i first created it on
windows, but the following error is shown: metadata = eval(metafile.read())
File "< string >", line 1

    
    
    @
    @
    @
    @
    @
    @
    

Any idea? thanks!


Answer: 
    dos2unix yourfile.py
    python yourfile.py
    

If you don't have `dos2unix`, here is some python code you can use instead.
Just put this in dos2unix.py, and run `python dos2unix.py yourfile.py` above:

    
    
    import sys
    filename = sys.argv[1]
    text = open(filename, 'rb').read().replace('\r\n', '\n')
    open(filename, 'wb').write(text)
    

This code was copied from [Python dos2unix one
liner](http://mail.python.org/pipermail/python-
list/2010-February/569661.html).

