Nested stream line iteration

Lars Lundgren d95lars at dtek.chalmers.se
Tue Jul 30 08:11:57 EDT 2002


Hi, 

I am an experienced programmer that tries python for the very first time.
I visited python.org and then wrote this program:

#!/usr/bin/env python

import sys, os, time, fileinput, string

def build( module, tag ):
    os.system( "cvs co " + tag + " " + module)

    filename = module + "/cvsDependencies"

    for line in fileinput.input(filename): 
        [m,t] = string.split( line )
        build( m,t )

    os.chdir(module)
    os.system( 'make -DVERSION="' + tag + '"')

build( "my_module", "-r v1_0" )


When I run it I get the following error:

    raise RuntimeError, "input() already active"
RuntimeError: input() already active

As I understand it, this means that it is not allowed to nest input() like
I do. Is that correct?

Then is there a working solution to my problem?

(I'm using Python 1.5.2 (#1, Jul  5 2001, 03:02:19)  [GCC 2.96 20000731
(Red Hat Linux 7.1 2 on linux-i386)

Thanx
/Lars L





More information about the Python-list mailing list