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


Groups > comp.lang.python > #89074

Re: Converting text file to different encoding.

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 <d@davea.name>
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 <d@davea.name>
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 <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.372.1429282649.12925.python-list@python.org> (permalink)
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

Show key headers only | View raw


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

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


Thread

Converting text file to different encoding. subhabrata.banerji@gmail.com - 2015-04-17 06:19 -0700
  Re: Converting text file to different encoding. Rustom Mody <rustompmody@gmail.com> - 2015-04-17 06:31 -0700
  Re: Converting text file to different encoding. subhabrata.banerji@gmail.com - 2015-04-17 06:51 -0700
    Re: Converting text file to different encoding. Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2015-04-17 15:05 +0100
      Re: Converting text file to different encoding. subhabrata.banerji@gmail.com - 2015-04-17 07:26 -0700
        Re: Converting text file to different encoding. Chris Angelico <rosuav@gmail.com> - 2015-04-18 00:41 +1000
          Re: Converting text file to different encoding. Marko Rauhamaa <marko@pacujo.net> - 2015-04-17 17:51 +0300
        Re: Converting text file to different encoding. Peter Otten <__peter__@web.de> - 2015-04-17 17:06 +0200
  Re: Converting text file to different encoding. Dave Angel <davea@davea.name> - 2015-04-17 10:48 -0400
  Re: Converting text file to different encoding. Dave Angel <d@davea.name> - 2015-04-17 10:57 -0400

csiph-web