ju2wheels / prettytable

Automatically exported from code.google.com/p/prettytable
Other
0 stars 0 forks source link

preetytable can't display chinese character normally. #49

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
please save the attachment "test.ansi",and to see the displayed table in my 
console.

from prettytable import  PrettyTable
fh= open("test.ansi", "r",encoding="gbk")
header=fh.readline().strip().split(",")
x = PrettyTable(header)
x.align["乘客姓名"]="l"
for row in fh.readlines():
    x.add_row(row.strip().split(","))

print(x)

Original issue reported on code.google.com by elearn2...@gmail.com on 12 Apr 2014 at 7:25

Attachments: