You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

41 lines
1.1 KiB

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: <Pine.SOL2.3.96.SK.990409141315.6969H-100000@sun.med.ru>
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.