Fredrik Lundh wrote:
> Stan Cook wrote:
>
>> I'm writing a script to list all of my music files' id3 tags to a
>> comma delimited file. The only part I'm missing seems like it should
>> be the simplest. I haven't used Python for the last couple of years.
>> My question is this:
>>
>> When I
"per9000" <[EMAIL PROTECTED]> writes:
> appendix = '.txt' # or '.csv' or whatever
>
> # some code
>
> c += 1
> filetitle = 'result_' + zeropadding(c) + str(c)
> myfile = open(filetitle+appendix,'w')
Resist the urge to construct strings by concatenation, when Python's
built-in string formatting
Ooops,
w must be 'w' - sorry for adding more confusion :-D
I would also like to add that this is a more realistic useage
appendix = '.txt' # or '.csv' or whatever
# some code
c += 1
filetitle = 'result_' + zeropadding(c) + str(c)
myfile = open(filetitle+appendix,'w')
# etc
Hope that was a l
Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Max Erickson wrote:
>
>>> # w is for writing
>>> myfile = open('theoutfile',w)
>>
>> That won't work, the second argument to open needs to be a string:
>
> w = 'w'
>
>
>
Is it inappropriate to call the w on the left side of the equal's sign
a stri
Max Erickson wrote:
>> # w is for writing
>> myfile = open('theoutfile',w)
>
> That won't work, the second argument to open needs to be a string:
w = 'w'
--
http://mail.python.org/mailman/listinfo/python-list
"per9000" <[EMAIL PROTECTED]> wrote:
> # w is for writing
> myfile = open('theoutfile',w)
That won't work, the second argument to open needs to be a string:
myfile = open('theoutfile', 'w')
max
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
This is what I often do:
somekindofoutput = ''
somekindofoutput += somefunk(somearg) + '\n'
# w is for writing
myfile = open('theoutfile',w)
myfile.write(somekindofoutput)
myfile.close()
also see
http://www.python.org/doc/2.3.5/tut/node9.html
or some other documentation
/P9k
--
http://ma
Stan Cook a écrit :
> I'm writing a script to list all of my music files' id3 tags to a comma
> delimited file. The only part I'm missing seems like it should be the
> simplest. I haven't used Python for the last couple of years. My
> question is this:
>
> When I use os.open(,"w"), I get an
Stan Cook wrote:
> I'm writing a script to list all of my music files' id3 tags
> to a comma delimited file. The only part I'm missing seems
> like it should be the simplest. I haven't used Python for
> the last couple of years. My question is this:
>
> When I use os.open(,"w"), I get an er
I'm writing a script to list all of my music files' id3 tags
to a comma delimited file. The only part I'm missing seems
like it should be the simplest. I haven't used Python for
the last couple of years. My question is this:
When I use os.open(,"w"), I get an error
message,TypeError
10 matches
Mail list logo