[Tutor] serial device emulator

Chris Fuller cfuller084 at thinkingplanet.net
Tue Jul 5 02:49:53 CEST 2011


You don't need to emulate a serial port (since you're writing the code; you'd 
have to emulate the port if it was standalone software), only your serial port 
library.  Write a class that has the same methods as the serial port library 
you're using (you only need the methods you're using or think you might use 
later), and fill them in with the appropriate code so it behaves like your real 
device.

Cheers

On Monday 04 July 2011, Edgar Almonte wrote:
> Hello list need some advice/help with something, i am doing a program
> in python that send some command via serial to a device so far so good
> , the thing is not have the program so i need make another program
> that emulate the behavior of this serial device ( is quiet simple ) to
> test my app
> i read abou that i can use pseudo terminal in linux but not sure how
> attatch the pseudo terminal /dev/pts5 example to a fake_device.py file
> or something like that.
> 
> maybe this question is not so python but i will appreciate some help.
> 
> 
> Thanks
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list