Posted on 2014-01-28 12:47:57 python
我们都知道,python里面可以用pdb来调试代码。但是pdb往往不大好用。有时候调试代码往往在多重条件里面,直接用pdb需要下条件断点,设定复杂的条件。
一个简单的办法就是这么干。
__import__('pdb').set_trace()
但是有的时候,连这个出现的条件都不满足。例如,代码必须在一个受限环境中运行,很难拿到console,或者其他林林总总的毛病。这时候,我们还有一招秘技。
import pdb, socket
s = socket.socket()
s.connect(('127.0.0.1', 8888))
f = s.makefile()
pdb.Pdb(stdin=f, stdout=f).set_trace()
在连接到的目标端口上,提前用nc做好监听,就可以在触发断点的时候直接连接上来调试。
свадьба дочери видео. виагра дешево спб danalite.ru ебётся с лошадью онлайн видео онлайн видео
online colleges north carolina auto insurance bakersfield ca point of sale software for mac
criminal defense houston https://uhod-za-kozhej-posle-leta.blogspot.com church newsletter software
марс картинки заказать попперс с доставкой смотреть хип-хоп батлы русских реперов
FES was produced and administered to the patient as described earlier 14, 28 stromectol dosis They also address the benefits of exercise pages 27 29
Hence, naturally occurring antioxidants such as flavonoids have been viewed as promising chemotherapeutic drugs for the management of cancer without causing damage to normal cells 12 propecia success rate