Python subprocess allow for user interaction
===

I am attempting to run a number of student FORTRAN programs from a python script.  These programs are not written in any particular order and often rely on the simple FORTRAN `read(*,*)` command.  A simple program could be:

    program main
        implicit none
        real :: p,t
        write(*,*)'Enter p'
        read(*,*)p
        write(*,*)'Enter t'
        read(*,*)t
        write(*,*)p,t
    end program main
This code pauses and allows the user to enter in certain information based on the prompt.  I would like similar feature by using the subprocess Popen command.  The script will not know what the inputs are before running, or if they even need to happen.

Currently, for programs with no necessary input the following script works:

    p = sub.Popen('./file',stdout=sub.PIPE,stderr=sub.PIPE,stdin=sub.PIPE,shell=True)
    output,error = p.communicate()
Is there any way to allow the script runner to enter the data in the terminal as the program is being run?