How to eliminate quotes around string field written to a file.

Shawn Milochik Shawn at milochik.com
Sat Nov 15 00:22:22 EST 2008


On Sat, Nov 15, 2008 at 12:19 AM, Steven D'Aprano
<steve at remove-this-cybersource.com.au> wrote:
> On Fri, 14 Nov 2008 20:39:53 -0800, len wrote:
>
>> hi
>>
>> Have this code in my program;
>>
>>     filename = 'custfile'
>>     codeline = filename + ' = [\n'
>>     output.write(codeline)
>>
>> record written to file look like this
>>
>>      "custfile" = [
>
> I cannot reproduce that behaviour. I suggest that the code you are
> running is not the same as the code you say you are running.
> --
> Steven


Same here. I don't get quotes around it. Also, how is "output"
defined? I got an error, so I used sys.stderr.write() instead.



More information about the Python-list mailing list