From: phd at sun.med.ru (Oleg Broytmann) Date: Fri, 9 Apr 1999 10:15:26 GMT Subject: two questions In-Reply-To: <370dbbe7.71248459@scout> References: <370dbbe7.71248459@scout> Message-ID: X-UID: 44 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.