[Tutor] Access files/folders

Bob Gailer bgailer@alum.rpi.edu
Wed Jun 25 10:20:02 2003


--=======58B3DDE=======
Content-Type: multipart/alternative; x-avg-checked=avg-ok-13356CED; boundary="=====================_5932630==.ALT"


--=====================_5932630==.ALT
Content-Type: text/plain; x-avg-checked=avg-ok-13356CED; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 8bit

At 10:57 PM 6/24/2003 -0400, GREENDAY31087@aol.com wrote:

>How can I access files on my computer using python? For example, I want to 
>open c:\programfiles\accessories\mspaint.exe
>Also, how would I go about deleting a file? and a folder? I'm running win98

What do you mean by "open"? Do you want to read/write the file or do you 
want to execute it (since the extension is .exe I assume you want to 
execute it).

For deleting see remove() in 6.1.4 Files and Directories in the Lang Ref 
under the os module.
For executing see 6.1.5 Process Management for various ways to execute 
programs.


Bob Gailer
bgailer@alum.rpi.edu
303 442 2625


--=====================_5932630==.ALT
Content-Type: text/html; x-avg-checked=avg-ok-13356CED; charset=us-ascii
Content-Transfer-Encoding: 8bit

<html>
<body>
At 10:57 PM 6/24/2003 -0400, GREENDAY31087@aol.com wrote:<br><br>
<blockquote type=cite class=cite cite><font size=2>How can I access files
on my computer using python? For example, I want to open
c:\programfiles\accessories\mspaint.exe<br>
Also, how would I go about deleting a file? and a folder? I'm running
win98</font><font face="arial"> </font></blockquote><br>
What do you mean by &quot;open&quot;? Do you want to read/write the file
or do you want to execute it (since the extension is .exe I assume you
want to execute it). <br><br>
For deleting see remove() in 6.1.4 Files and Directories in the Lang Ref
under the os module.<br>
For executing see 6.1.5 Process Management for various ways to execute
programs.<br><br>
<x-sigsep><p></x-sigsep>
<font face="arial">Bob Gailer<br>
bgailer@alum.rpi.edu<br>
303 442 2625<br>
</font></body>
</html>


--=====================_5932630==.ALT--

--=======58B3DDE=======
Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-13356CED
Content-Disposition: inline


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.492 / Virus Database: 291 - Release Date: 6/24/2003

--=======58B3DDE=======--