Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!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.062 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'subject:text': 0.05; 'subject:file': 0.07; '"w")': 0.16; 'subject:Converting': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'later': 0.20; '>>>': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'header :In-Reply-To:1': 0.27; 'idea': 0.28; 'am,': 0.29; 'usually': 0.31; 'object.': 0.31; 'file': 0.32; "didn't": 0.36; 'error.': 0.37; 'to:addr:python-list': 0.38; 'quote': 0.39; 'to:addr:python.org': 0.39; 'dave': 0.60; 'email addr:gmail.com': 0.63; 'name': 0.63; 'charset:windows-1252': 0.65; 'brain': 0.68; 'received:74.208': 0.68; 'angel': 0.91 Date: Fri, 17 Apr 2015 10:57:26 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Converting text file to different encoding. References: <6bddf2c0-b0c3-456d-a699-d6c921e6fc73@googlegroups.com> <55311D59.90102@davea.name> In-Reply-To: <55311D59.90102@davea.name> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:D0y7QkChWNRIgCKGgXc8Xus+mBPoChOyTGie06lbrViXzwGxvfQ 801wYDo90+tcQOyQaj751OTfL2VCvGzFda7fmUALgysYI6l8OIW6WDzeC/m7aoKsWnhq03u Wjutbi4znxqoq5DW0wHmS4cDv2xIoXmHM2kdIKqvi+X3AUW8ufzkgL5M6gplrvvRc42KHpp SxmTgZy9XyWnt4qUB5txw== X-UI-Out-Filterresults: notjunk:1; X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1429282649 news.xs4all.nl 2958 [2001:888:2000:d::a6]:49612 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:89074 On 04/17/2015 10:48 AM, Dave Angel wrote: > On 04/17/2015 09:19 AM, subhabrata.banerji@gmail.com wrote: >> >>> target = open("target", "w") > > It's not usually a good idea to use the same variable for both the file > name and the opened file object. What if you need later to print the > name, as in an error message? Oops, my error. Somehow my brain didn't notice the quote marks, until I reread my own message online. -- DaveA