Article View: es.comp.os.linux.programacion
Article #8047Re: Leer un fichero
From: amphora
Date: Fri, 10 Jan 2003 00:21
Date: Fri, 10 Jan 2003 00:21
40 lines
2250 bytes
2250 bytes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El Fri, 3 Jan 2003 22:28:49 +0000 (UTC), Eru dijo: >> Hala, ahora lanzo el pique...quien se atreve a hacerlo en brainfuck? >> (leyendo de la entrada estandard) >> Yo no me veo con fuerzas, que el atoi() del bf es infernal...y la >> division no quiero ni imaginarmela �Algo as�? #!/usr/bin/env python import sys nums = 0 j = 0 total = 0 for i in sys.stdin: num=float(i) nums += num j += 1 total = round(nums/j) print total amphora@hamlet:~$ cat numeros.txt | ./pr3.py 673.0 - -- "La pipa quan �s nova/ te gust de soc,/quan �s a mitg fumar / te gust de mel,/ i quan es vella,/ t� gust de cel" (Copla an�nima catalana) amphora at escomposlinux dot org http://julieta.escomposlinux.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+HhICbxRsnxqoy84RAuDuAJ4km97RIDqXKhOmEr4ufGzhTAlGRACghedw NxfVoG24SipgnlG+kTWJfgc= =o6An -----END PGP SIGNATURE-----
Technical Details
Message-ID:
<slrnb1s4ft.jn.amphora@hamlet.escomposlinux.org>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!newsfeed.vmunix.org!fr.clara.net!heighliner.fr.clara.net!proxad.net!news-hub.cableinet.net!blueyonder!marmolejo.escomposlinux.org!antonio.escomposlinux.org!julieta.escomposlinux.org!hamlet.escomposlinux.org!newsReferences:
<7d4ff0e4.0301020707.6388a1a6@posting.google.com> <av52r1$dsm$1@sofora01.uji.es>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,5cf283a7acb0d167 X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2003-01-10 09:07:38 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!newsfeed.vmunix.org!fr.clara.net!heighliner.fr.clara.net!proxad.net!news-hub.cableinet.net!blueyonder!marmolejo.escomposlinux.org!antonio.escomposlinux.org!julieta.escomposlinux.org!hamlet.escomposlinux.org!news From: amphora <amphora@hamlet.escomposlinux.org> Newsgroups: es.comp.os.linux.programacion Subject: Re: Leer un fichero Date: Fri, 10 Jan 2003 01:21:22 +0100 Organization: Ecolnet Lines: 40 Message-ID: <slrnb1s4ft.jn.amphora@hamlet.escomposlinux.org> References: <7d4ff0e4.0301020707.6388a1a6@posting.google.com> <av52r1$dsm$1@sofora01.uji.es> Reply-To: amphora@escomposlinux.org NNTP-Posting-Host: hamlet.escomposlinux.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: julieta.escomposlinux.org 1042218454 15928 192.168.1.16 (10 Jan 2003 17:07:34 GMT) X-Complaints-To: usenet@julieta.escomposlinux.org NNTP-Posting-Date: Fri, 10 Jan 2003 17:07:34 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux)