pythonansi-escape

How do i open ANS files in python?


Python 2.7.8 (with colorama) doesn't seem to load ANS files correctly. When i print an ANS file out, the output is blank.

The code is is: o = open("C:\ANSI\DATA\MENU1.AMS", 'r') print(o) Am i forgetting a special character or something?


Solution

  • Here you are not at all printing the contents of the file.

    You can do it using the read() function.

    Doing it like print(o.read()) would work fine.