Editing two files in PVCS with Python ? (was:Run an external...)

V V at V.V
Sat Nov 11 11:58:00 EST 2000


Michael P. Soulier wrote in message
>
>In article <68bO5.176$cr6.1345 at news1.oke.nextra.no>, Syver Enstad wrote:
>
>>"Joakim Hove" <hove at phys.ntnu.no> wrote in message
>>>
>>> I am writing a small python program to automate the compilation of
>>> another (fortran) program. In this process I need my python program to
>>> call the "make" program.
>>>
>>> In Perl I would do simply:
>>>
>>>   system("make PROG=Run");
>>>
>>> And the Perl program would wait around till the system call was
>>> finished.
>>
>>So do:
>>import os
>>os.system('make PROG=Run')
>>
>>and the system call blocks too while the other program is running.
>>
>    Or check out the commands module if you want the output of the command,
>ala Perl backticks. 
>

My problem might be close to this one. and I'm a python newbie, so...

I'm trying to make a python script to automate a makefile update
process. There are two different makefiles in version control system and
the second one needs the version number of the first one.

So first I make the correct system calls as above to check-out, update
and check-in the first makefile. But after the check-in :

        os.system(' put c:\something\foo.c ')

the version control system prints something like this :

        "version 1.5 of file foo.c was checked in."

The problem is that how do get the version number from the first
check-in, because it's needed in the second makefile update ?

Michael S. is talking something about "the output of the command" above.
Is that what I need and how do I "check out the commands module" ?

t. V



More information about the Python-list mailing list