Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #79871

Re: Anyone know the solution

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!feeder1-1.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'statements': 0.09; 'subject:Anyone': 0.09; 'wrote': 0.14; 'file1': 0.16; 'received:80.91.229.3': 0.16; 'received:97': 0.16; 'received:plane.gmane.org': 0.16; 'simpson': 0.16; 'skip:> 20': 0.16; 'subsequently': 0.16; 'wrote:': 0.18; 'print': 0.22; 'this?': 0.23; 'question': 0.24; 'header:X -Complaints-To:1': 0.27; 'code': 0.31; 'comments': 0.31; 'file': 0.32; 'probably': 0.32; 'not.': 0.33; 'subject:the': 0.34; 'there': 0.35; 'skip:> 10': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'read': 0.60; "you're": 0.61; 'sample': 0.67; 'accompany': 0.84; 'subject:know': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dave Angel <davea@davea.name>
Subject Re: Anyone know the solution
Date Tue, 28 Oct 2014 22:11:26 -0400 (EDT)
Organization news.gmane.org
References <f9c39375-d0ff-4f16-aa05-6d8c8fdf7267@googlegroups.com> <20141029005346.GA48374@cskk.homeip.net>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 97.73.240.68
X-Newsreader PiaoHong.Usenet.Client.VIP:1.62
X-Archive encrypt
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.15277.1414548479.18130.python-list@python.org> (permalink)
Lines 39
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1414548479 news.xs4all.nl 2855 [2001:888:2000:d::a6]:46828
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:79871

Show key headers only | View raw


Cameron Simpson <cs@zip.com.au> Wrote in message:
> On 28Oct2014 09:07, ngangsia akumbo <ngangsia@gmail.com> wrote:
>>This is a sample code on how to read data from a file
>>
>>files1 {}
>>
>>result = open("file1.txt")
>>for line in result:
>>    file1 = line>split()
>>files1.append(file1)
>>result.close()
>>file1.sort()
>>file1.reverse()
>>
>>print('THE FILE INFO')
>>
>>print(file1(0)
>>print(file1(1)
> 
> Do you have a specific question to accompany this?
> 
> The code above is syntactly invalid, so it will not run.
> 
> ....
> 
> Your final print statements need an extra closing parenthesis each.
> 
> 

Other comments -

The line that appends probably wants to be in the loop, and is not.

Is there a reason you're subsequently processing only the last line?


-- 
DaveA

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Anyone know the solution emmanueloje@gmail.com - 2014-10-27 08:10 -0700
  Re: Anyone know the solution alister <alister.nospam.ware@ntlworld.com> - 2014-10-27 15:21 +0000
  Re: Anyone know the solution Joel Goldstick <joel.goldstick@gmail.com> - 2014-10-27 11:20 -0400
  Re: Anyone know the solution Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-10-27 20:18 -0400
  Re: Anyone know the solution Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-28 00:20 +0000
  Re: Anyone know the solution alex23 <wuwei23@gmail.com> - 2014-10-28 10:33 +1000
    Re: Anyone know the solution Anton <anton.schattenfeld@gmail.com> - 2014-10-28 18:28 -0700
      Re: Anyone know the solution alex23 <wuwei23@gmail.com> - 2014-10-29 12:03 +1000
      Re: Anyone know the solution Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-10-29 18:13 +1300
        Re: Anyone know the solution Anton <anton.schattenfeld@gmail.com> - 2014-10-29 17:09 -0700
  Re: Anyone know the solution Terry Reedy <tjreedy@udel.edu> - 2014-10-28 00:24 -0400
    Re: Anyone know the solution "Mario R. Osorio" <nimbiotics@gmail.com> - 2014-10-28 08:38 -0700
  Re: Anyone know the solution ngangsia akumbo <ngangsia@gmail.com> - 2014-10-28 09:07 -0700
    Re: Anyone know the solution Cameron Simpson <cs@zip.com.au> - 2014-10-29 11:53 +1100
    Re: Anyone know the solution Dave Angel <davea@davea.name> - 2014-10-28 22:11 -0400
  Re: Anyone know the solution Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-29 18:03 +0000

csiph-web