how to call external functions from python

Chris Barker chrishbarker at home.net
Wed Nov 28 15:50:34 EST 2001


weeang wrote:
> i need help on the following:
> 
> 1) find all files in inbox directory and zip them
> 2) move the zipped file to outbox
> 3) copy the zipped file to a remote directory
> 
> pls help on the following as i m very new to python, and could not
> find the exact help that i need in the faq, help, etc.
> 
> i m using python 2.1, using windows for my initial testing.  however,
> i will subsequently use the script on a linux box instead.

What you probably want is some combination of:

import os

os.system()
os.listdir()
os.rename()

and you also might want to look at the shutil module and the zipfile
module

The Library Refernece is your friend!

http://www.python.org/doc/current/lib/lib.html

-Chris



-- 
Christopher Barker,
Ph.D.                                                           
ChrisHBarker at home.net                 ---           ---           ---
http://members.home.net/barkerlohmann ---@@       -----@@       -----@@
                                   ------@@@     ------@@@     ------@@@
Oil Spill Modeling                ------   @    ------   @   ------   @
Water Resources Engineering       -------      ---------     --------    
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------



More information about the Python-list mailing list