香槟酒 <[EMAIL PROTECTED]> added the comment:
Thank you for your reply.I mean I used gvim to open a file. the Python
manual did not specify how to use a file, but said that if a file is to be
used, the deletion of the file will be exception to be raise.so when I use
gvim to open a file, then run os.remove () method to remove the file, the
file is deleted, and no exception to be raise.
2008/7/28 Facundo Batista <[EMAIL PROTECTED]>
>
> Facundo Batista <[EMAIL PROTECTED]> added the comment:
>
> zkfarmer, please try the following from your IDLE:
>
> >>> myfilename = r"c:\tmp\test.txt"
> >>> fh = open(myfilename, "w")
> >>> fh.write("test\n")
> >>> fh.close()
> >>> fh = open(myfilename)
> >>> import os
> >>> os.remove(myfilename)
>
> Traceback (most recent call last):
> File "<pyshell#6>", line 1, in <module>
> os.remove(myfilename)
> WindowsError: [Error 32] The process cannot access the file because it
> is being used by another process: 'c:\\tmp\\test.txt'
> >>>
>
> ...and copy here what happened.
>
> Thanks!
>
> ----------
> nosy: +facundobatista
>
> _______________________________________
> Python tracker <[EMAIL PROTECTED]>
> <http://bugs.python.org/issue3455>
> _______________________________________
>
Added file: http://bugs.python.org/file10994/unnamed
_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3455>
_______________________________________
<div dir="ltr"><div dir="ltr">Thank you for your reply.I mean I used gvim to
open a file. the Python manual did not specify how to use a file, but said that
if
a file is to be used, the deletion of the file will be exception to be raise.so
when I use gvim to open a file, then run os.remove () method to
remove the file, the file is deleted, and no exception to be
raise.</div><br><br><div class="gmail_quote">2008/7/28 Facundo Batista <span
dir="ltr"><<a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204,
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Facundo Batista <<a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>> added the comment:<br>
<br>
zkfarmer, please try the following from your IDLE:<br>
<br>
>>> myfilename = r"c:\tmp\test.txt"<br>
>>> fh = open(myfilename, "w")<br>
>>> fh.write("test\n")<br>
>>> fh.close()<br>
>>> fh = open(myfilename)<br>
>>> import os<br>
>>> os.remove(myfilename)<br>
<br>
Traceback (most recent call last):<br>
File "<pyshell#6>", line 1, in <module><br>
os.remove(myfilename)<br>
WindowsError: [Error 32] The process cannot access the file because it<br>
is being used by another process: 'c:\\tmp\\test.txt'<br>
>>><br>
<br>
...and copy here what happened.<br>
<br>
Thanks!<br>
<br>
----------<br>
nosy: +facundobatista<br>
<div><div></div><div class="Wj3C7c"><br>
_______________________________________<br>
Python tracker <<a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>><br>
<<a href="http://bugs.python.org/issue3455"
target="_blank">http://bugs.python.org/issue3455</a>><br>
_______________________________________<br>
</div></div></blockquote></div><br></div>
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com