Re: [Tutor] Delete file before function ends

2008-10-06 Thread Adrian Greyling
I'll take a peek at the subprocess docs Steve, and see if I can learn something there... Thanks for the suggestion! I'm using WinXP as well Wayne.. Not too sure why yours works, and mine doesn't.. I'll revisit what I'm doing and also check into Steve's suggestion. Adrian On Mon, Oct 6, 200

Re: [Tutor] Delete file before function ends

2008-10-06 Thread W W
What OS are you using, Adrian? On WinXP, this worked fine: import os def files(): os.startfile('myfile.txt') os.remove('myfile.txt') -Wayne ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Delete file before function ends

2008-10-06 Thread Steve Willoughby
On Mon, Oct 06, 2008 at 02:15:06PM -0400, Adrian Greyling wrote: > As a newbie, Alan, I was kinda scared you'd say that "threads" were the > answer here! (It sounds like someone is going to get sucked into a worm > hole or something...) Looks like the next class in my Python education is > going

Re: [Tutor] Delete file before function ends

2008-10-06 Thread Adrian Greyling
Thanks for the input folks. Sadly, Tim's suggestion yields the same results as I was getting previously. My second program very graciously tells me that the file I'm trying to open doesn't exist. Like the code snippet I posted, the timer.sleep(x) line just waits the 'x' seconds until opening 'myt

Re: [Tutor] Delete file before function ends

2008-10-06 Thread Alan Gauld
"Adrian Greyling" <[EMAIL PROTECTED]> wrote that creates my "problem"... What I'd like to do, is create a plain text file, use the associated program to open said textfile, (using os.startfile) and after the associated program has what it needs to open the file and then of course, has the c

Re: [Tutor] Delete file before function ends

2008-10-06 Thread Tim Golden
Adrian Greyling wrote: path = "c:\MyFolder\mytextfile.xyz" BTW, I hope you're using raw strings in your real code, or else you're going to come a cropper one day when a filename begins with "t". TJG ___ Tutor maillist - Tutor@python.org http://ma

Re: [Tutor] Delete file before function ends

2008-10-06 Thread Tim Golden
Adrian Greyling wrote: Not sure if this is possible, but I'll ask anyway. Below is a code snippet that creates my "problem"... What I'd like to do, is create a plain text file, use the associated program to open said textfile, (using os.startfile) and after the associated program has what it ne

[Tutor] Delete file before function ends

2008-10-06 Thread Adrian Greyling
Greetings all, Not sure if this is possible, but I'll ask anyway. Below is a code snippet that creates my "problem"... What I'd like to do, is create a plain text file, use the associated program to open said textfile, (using os.startfile) and after the associated program has what it needs to op