Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.026 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'subject:file': 0.07; 'f.close()': 0.09; 'def': 0.12; 'subject:arithmetic': 0.16; 'import': 0.22; 'to:name:python-list@python.org': 0.22; 'print': 0.22; 'received:65.55.116': 0.24; 'subject:/': 0.26; 'header:In- Reply-To:1': 0.27; 'skip:- 40': 0.29; 'url:mailman': 0.30; 'url:python': 0.33; 'url:listinfo': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'email addr:gmail.com': 0.63 X-TMN: [YFL3IwBxzAOkJvABrBQ4vwEL3AbGef2Q] X-Originating-Email: [carlosnepomuceno@outlook.com] From: Carlos Nepomuceno To: "python-list@python.org" Subject: RE: file I/O and arithmetic calculation Date: Thu, 23 May 2013 03:02:09 +0300 Importance: Normal In-Reply-To: References: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 23 May 2013 00:02:09.0917 (UTC) FILETIME=[C54442D0:01CE5748] X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369267337 news.xs4all.nl 15990 [2001:888:2000:d::a6]:60921 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45761 ----------------------------------------=0A= > From: denismfmcmahon@gmail.com=0A= [...]=0A= >=0A= > import re=0A= > def v(s):=0A= > l=3Dlen(s)=0A= > t=3D0.=0A= > for i in range(l):=0A= > t=3Dt+(abs(ord(s[i]))*1.)=0A= > return t/(l*1.)=0A= > for n in range(5):=0A= > m=3D"c:/test/"+str(n+1)+".txt"=0A= > f=3Dopen(m=2C"r")=0A= > d=3D[]=0A= > t=3D0.=0A= > for l in range(10):=0A= > d=3Dd+[re.findall(r"[0-9.eE+-]+"=2Cf.readline())]=0A= > t=3Dt+v(d[l][0])=0A= > f.close()=0A= > c=3Dt/10.=0A= > if c=3D=3D50.:=0A= > t=3D0.=0A= > for u in range(10):=0A= > t=3Dt+v(d[0][u])=0A= > r=3Dt/10.=0A= > print "%s C1: %f R1: %f"%(m=2Cc=2Cr)=0A= >=0A= > --=0A= > Denis McMahon=2C denismfmcmahon@gmail.com=0A= > --=0A= > http://mail.python.org/mailman/listinfo/python-list=0A= =0A= Can you send it again without tabs? =