Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'attribute': 0.07; 'snippet': 0.07; 'advance.': 0.09; 'loop.': 0.09; 'received:mail- lpp01m010-f46.google.com': 0.09; 'error:': 0.10; 'subject:file': 0.13; 'innermost': 0.16; 'subject:loops': 0.16; 'subject:writing': 0.16; 'traceback.': 0.16; 'cc:addr:python-list': 0.16; 'wed,': 0.17; 'wrote:': 0.18; 'help.': 0.19; "doesn't": 0.22; 'header:In- Reply-To:1': 0.22; 'feb': 0.22; 'fine,': 0.23; 'cc:2**0': 0.26; 'code': 0.26; "i'm": 0.28; 'message-id:@mail.gmail.com': 0.29; 'cc:addr:python.org': 0.29; 'pm,': 0.29; 'error': 0.30; 'received:209.85.215.46': 0.32; 'thanks': 0.32; 'actual': 0.32; 'error.': 0.32; 'loop': 0.34; 'wondering': 0.34; 'hi,': 0.34; 'someone': 0.34; 'post': 0.36; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'enough': 0.38; 'could': 0.38; 'some': 0.38; 'getting': 0.38; 'subject:from': 0.39; 'received:209.85.215': 0.39; 'received:209': 0.39; 'might': 0.40; 'full': 0.62; 'us.': 0.64; 'here.': 0.64 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=I2Pgn/OK30XxBmcK+lVkYG3flA7Enzv+F0ZlPWhlNC8=; b=fXvbu481QvLXI8nto+6NTg76OdL4HnO4G9MCl0GmiNIWdA1vogUDfwZs9uqockCX4C vEpMWIBxAfjKHTqmNs9g0yClkIKNQkGRHt6ZNfGoBoHp9cDlXrU1Lnla4i09saUTcmGj sbMMlpsnF+tEnA5RmsFjpxFMpVd7o7MOkLbUo= MIME-Version: 1.0 In-Reply-To: <77a0e187170dca.4f3bbd59@wiscmail.wisc.edu> References: <75208cce174437.4f3bf1a2@wiscmail.wisc.edu> <77a0ddfa17203f.4f3bf1de@wiscmail.wisc.edu> <775093eb1740b6.4f3bf21b@wiscmail.wisc.edu> <7760fe7a17153d.4f3bf258@wiscmail.wisc.edu> <75909037172f2d.4f3bf294@wiscmail.wisc.edu> <76f0965b175c1f.4f3bf2d0@wiscmail.wisc.edu> <77c0ac1d173db4.4f3bf403@wiscmail.wisc.edu> <7750b096170a1e.4f3c11b5@wiscmail.wisc.edu> <77a0e187170dca.4f3bbd59@wiscmail.wisc.edu> From: Ian Kelly Date: Wed, 15 Feb 2012 13:32:51 -0700 Subject: Re: writing to a file from within nested loops To: Rituparna Sengupta Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1329338002 news.xs4all.nl 6968 [2001:888:2000:d::a6]:52360 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20470 On Wed, Feb 15, 2012 at 1:12 PM, Rituparna Sengupta wr= ote: > Hi, > > I'm working on this code and I keep getting an error. It might be some ve= ry basic thing but I was wondering if someone could help. Its a loop within= a loop. The part outside the innermost loop gets printed fine, but the par= t within the innermost loop doesn't get printed. I get an error: 'str' has = no attribute 'write'. Thanks in advance. There's not enough to go on here. Please post the actual code snippet and the full traceback. Don't summarize the error for us.