Saturday, January 17, 2015

Inject arbitrary code into a running Python process

$ pyrasite-shell $(pgrep -f "ipython")
Pyrasite Shell 2.0beta9
Connected to 'ipython'
Python 2.7.2 (default, Oct 27 2011, 01:40:22)
[GCC 4.6.1 20111003 (Red Hat 4.6.1-10)] on linux2
>>> print(x)
foo

>>> globals()['x'] = 'bar'


https://pyrasite.readthedocs.org/en/latest/index.html

No comments:

Post a Comment