Short question about module termios

David Stein dstein at cts.ucla.edu
Wed May 26 00:18:33 EDT 1999


Hello. 

I am new to Python and am using module termios.  Everything seems pretty
straightforward, with one exception:  I don't know how to disable
special character handling.  In other words, I don't know how to do what
the following C code does, where fd is an open tty: 

#include <termios.h> 

struct termios t ; 
cc_t vdisable ;
long rv ; 

vdisable = fpathconf(fd,_PC_VDISABLE) ;

t.c_cc[VINTR]  = vdisable ;
t.c_cc[VQUIT]  = vdisable ;
t.c_cc[VERASE] = vdisable ;
t.c_cc[VKILL]  = vdisable ;
t.c_cc[VEOF]   = vdisable ;

...and so on. 

The only part I don't know how to do in Python is the fpathconf() part. 
In other words, how do I get the proper value with which to disable a
special character?  I have looked at TERMIOS.py, and I still don't know
how to do it.  The rest is fairly clear to me.  Any suggestions? 

                             Thanks, 
                             David Stein




More information about the Python-list mailing list