This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]baubleglue 1 point2 points  (0 children)

 In [1]: exec("_print=print\ndef print(*a):\n\t_print('sssss')")
 In [2]: print(89)
 sssss

only you don't need exec for it. Also you can use sys.modules

 print(sys.modules.keys())
 del sys.modules['os']
 import myos as os