Doubt with files

José Manuel Suárez Sierra josemsuarezsierra at gmail.com
Tue Feb 14 12:13:48 EST 2017


hello,
im trying to read a rtf or txt file with this python script:

with open(dirFichero,'r') as reader:
    for line in reader:
        print line

the problem is that shown is :

{\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf810

{\fonttbl\f0\fswiss\fcharset0 Helvetica;}

{\colortbl;\red255\green255\blue255;}

{\*\expandedcolortbl;;}

\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0

\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0



\f0\fs24 \cf0 1l2m,1svo,1lme}


INSTEAD of:
1l2m,1svo,1lme

How could I fix it?

THANK YOU



More information about the Python-list mailing list