File Creation Not Working In A Thread Class?
Duncan Booth
duncan.booth at invalid.invalid
Mon May 12 03:20:48 EDT 2008
bc90021 <python at bc90021.net> wrote:
> On Sun, 11 May 2008 19:55:31 +0000, Duncan Booth wrote:
>
>> 7stud <bbxx789_05ss at yahoo.com> wrote:
>>
>>
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â tempfileName =
>>> "\"proctemp\\" Â Â Â Â Â Â Â Â Â Â Â Â Â Â +
>>> self.matrix[c][0] + "_other.txt\""
>>
>> It wouldn't exactly result in either of the error messages you
>> posted, but I expect the spurious quote marks round the filename will
>> be giving you problems.
>>
>> Surely you want the filename to be something like
>> 'proctemp\fred_other.txt' rather than '"proctemp\fred_other.txt"'
>> with the spurious double quotes?
>
> Yup, that's what it was. I figured it out two seconds before this
> post. However, it will be interesting to see how it handles files
> with spaces in the name...
>
It will handle spaces just fine.
You need to try and understand the difference between passing arguments to
a program, where the shell will try to parse the command line into separate
arguments so spaces have to be escaped somehow, and calling a function
within a program where no such parsing takes place.
More information about the Python-list
mailing list