<s> import sys <EOL> import os <EOL> from Rpyc import * <EOL> from Rpyc . Utils import remote_interpreter <EOL> c = SocketConnection ( "<STR_LIT:localhost>" ) <EOL> sys . stdout = c . modules . sys . stdout <EOL> print "<STR_LIT>" <EOL> sys . stdout = sys . __stdout__ <EOL> c . modules . sys . stdout = sys . stdout <EOL> c . modules . sys . stdout . write ( "<STR_LIT>" ) <EOL> c . modules [ "<STR_LIT>" ] . printer ( "<STR_LIT>" ) <EOL> c . modules . sys . stdout = c . modules . sys . __stdout__ <EOL> def f ( text ) : <EOL> print text <EOL> c . modules [ "<STR_LIT>" ] . caller ( f , "<STR_LIT>" ) <EOL> def g ( func , text ) : <EOL> c . modules [ "<STR_LIT>" ] . caller ( func , text ) <EOL> c . modules [ "<STR_LIT>" ] . caller ( g , f , "<STR_LIT>" ) <EOL> print hasattr ( sys , "<STR_LIT:path>" ) <EOL> print hasattr ( c . modules . sys , "<STR_LIT:path>" ) <EOL> print getattr ( sys , "<STR_LIT>" ) <EOL> print getattr ( c . modules . sys , "<STR_LIT>" ) <EOL> print reload ( sys ) <EOL> print reload ( c . modules . sys ) <EOL> f = open ( "<STR_LIT>" , "<STR_LIT:w>" ) <EOL> f . write ( "<STR_LIT>" ) <EOL> f . close ( ) <EOL> upload ( c , "<STR_LIT>" , "<STR_LIT>" ) <EOL> os . remove ( "<STR_LIT>" ) <EOL> c . modules . os . remove ( "<STR_LIT>" ) <EOL> remote_interpreter ( c ) <EOL> print "<STR_LIT>" </s>
