Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'debugging': 0.07; 'data:': 0.09; 'method,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:into': 0.09; 'subject:string': 0.09; 'subject:How': 0.10; 'nick': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:already': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'error': 0.23; 'server.': 0.24; 'this:': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'see,': 0.30; 'subject:list': 0.30; 'but': 0.35; '+0200,': 0.36; 'impression': 0.36; 'machine.': 0.36; "didn't": 0.36; 'method': 0.36; 'easily': 0.37; 'being': 0.38; 'expected': 0.38; 'nov': 0.38; 'to:addr:python-list': 0.38; 'previous': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'act': 0.63; 'more': 0.64; 'subject:add': 0.91; 'received:108': 0.93; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re: How to add a current string into an already existing list Date: Tue, 05 Nov 2013 05:00:33 -0600 References: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: pool-108-12-82-77.hstntx.dsl-w.verizon.net In-Reply-To: User-Agent: Groundhog Newsreader for Android 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1383649248 news.xs4all.nl 15926 [2001:888:2000:d::a6]:51416 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:58497 On Tue, 05 Nov 2013 11:34:53 +0200, Nick the Gr33k wrote: > I see, but because of the traceback not being to express it more easily > i was under the impression that data wasn't what i expected it to be. Exactly. So why didn't you act on that impression? Your error message told you that data was a method, and that a method is not iterable. The previous line is where you assigned it. Try debugging this: infile = open("myfile.txt") data = infile.readlines for line in data: print(line) Not on a server. On your own machine. -- DaveA