script files with python (instead of tcsh/bash)?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sun Mar 22 12:45:21 EDT 2009


En Sun, 22 Mar 2009 11:05:22 -0300, MRAB <google at mrabarnett.plus.com>  
escribió:
> Esmail wrote:
>> Nick Craig-Wood wrote:
>>> Esmail <ebonak at hotmail.com> wrote:
>>>>  I am wondering if anyone is using python to write script files?

>>  Two quick questions:
>>  As a replacement for grep I would use the re module and its methods?

Perhaps; but strings have methods too (`"abc" in line` is easier to read,  
and faster, than the corresponding r.e.)

>> The other things I need to do consist of moving files, manipulating file
>> names and piping outputs of one command to the next, so I'm digging into
>> the documentation as much as I can.
>>
> The 'os' and 'shutil' modules.

And for executing external commands with piping, I'd add the subprocess  
module.

-- 
Gabriel Genellina




More information about the Python-list mailing list