I'm a new learner of Python and use python 2.7 in mac ox 10.8.3.
Today I met a problem that python don't get the right data when executing file reading.
my input file include two website url like this:
www.google.com
www.facebook.com
and python codes are below, just to print the input:
f = open("weblist.rtf","r")
print f.read()
f.close()
But after run, output is like this:
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf370
{\fonttbl\f0\fnil\fcharset134 STHeitiSC-Medium;}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww12200\viewh12840\viewkind1
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
\f0\b\fs36 \cf0 www.google.com\
www.facebook.com}
How to solve this problem? Anyone has suggestion?