In article <[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]> wrote:
>
> [ ... ]
>
>for fileName in fileNames:
> fileBeginning = os.path.splitext(fileName)[0]
> fileEnd = os.path.splitext(fileName)[1]
>
> if fileEnd == ".py":
>print fileName
>f=open(fileBeginning+".tmp", 'w')
>f.write("
On Mon, 30 Jul 2007 07:36:00 -0700, [EMAIL PROTECTED] wrote:
>Hi,
>
> [snip]
>f=open(fileBeginning+".tmp", 'w')
>f.write("Hello")
>f.close
>
You forgot to call close. Try this final line, instead:
f.close()
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> I'm in the process of writing some code and noticed a strange problem
> while doing so. I'm working with PythonWin 210 built for Python 2.5. I
> noticed the problem for the last py file processed by this script,
> where the concerned tmp file is only actually written to
On Mon, 30 Jul 2007 16:36:00 +0200, <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm in the process of writing some code and noticed a strange problem
> while doing so. I'm working with PythonWin 210 built for Python 2.5. I
> noticed the problem for the last py file processed by this script,
> where the c
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm guessing the garbage collector is causing the file to be written,
> but shouldn't close do this?
Only if you call it ;)
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm in the process of writing some code and noticed a strange problem
while doing so. I'm working with PythonWin 210 built for Python 2.5. I
noticed the problem for the last py file processed by this script,
where the concerned tmp file is only actually written to when
PythonWin is closed. In