C. Ulrich
C. Ulrich

Reputation: 1

Redirect rpyc remote stdio to stream

It is possible to redirect remote stdio with rpyc to local stdio, but is that possible to do that with an custom stream, and react to it ?

Finally i want to redirect rpyc stdio and an serial port stream to the same stream class and handle it with the same class.

Soes somebody has an example for that or an hint how to start ?

Upvotes: -2

Views: 176

Answers (1)

C. Ulrich
C. Ulrich

Reputation: 1

For somebody who has an similar problem: you can override stdout with an own class or an io.StringIO.

It must just implement write() where one can do whatever to do. This works also for an rpyc connection

rpyc_conn.modules.sys.stdout = io.StringIO()

works.

Upvotes: 0

Related Questions