initilize a memory zone in python

Diez B. Roggisch deets at nospam.web.de
Sun Aug 30 16:58:54 EDT 2009


Mug schrieb:
> hello, i'm new in python, i used to program in C,
> i have a small problem, i tryed to do some serial port things
> manipulation
> with python.
> i have something like:
> 
> import sys,termios
> 
> fd = sys.stdin.fileno()
> term_conf=termios.tcgetattr(fd);
> 
> now i want to modify the actuall values in term_conf  zone to zero
> i don't see how to do it,
> in C we can do : bzero(&term_conf,sizeof(struct termios));
> i want to know if it exist a similar function in python, thanks

In python you don't modify memory like that.

For the above function, you pass a value as the one you got to 
tcgetattr, with values modified as you desire them.

Diez



More information about the Python-list mailing list