two questions

Oleg Broytmann phd at sun.med.ru
Fri Apr 9 06:15:26 EDT 1999


On Fri, 9 Apr 1999, Chris... wrote:
>   Since I am new to python (ver 1.5 under NT), these may be silly,
> anyhow:
> 
> 1)  How can I copy files with python?  At first I planned to run the
> DOS-command "copy" from python, but couldn't find the right function.
> Second, I thought, there might be a python command to do it.  Until
> now, I didn't succeed.

   Look into shutil.py module. You need copy2() function.

> 2) Is there an way to mimic Perls
> perl -p -e s/pattern1/pattern2/
> command line?

   Although you can run python -c "script", python usually intended for
scripts, not for perl-like one-liners.

> Thanks a lot in advance
> 
> bye
>   Chris...
> 

Oleg.
---- 
    Oleg Broytmann  National Research Surgery Centre  http://sun.med.ru/~phd/
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list