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做好监听,就可以在触发断点的时候直接连接上来调试。
cbd tinctures http://buycbdoilwalm.com/ - cbd oil benefits cbd cbd hemp cbd oil at walmart
cbd oil for pain hemp oil cbd capsules cbd for sale http://buycbdoilonline.us.com/ - cbd oils
pharmacy in canada ed medications erection pills
canada drug Combivir canada viagra
canadian pharmacy online viagra prescription drugs online without canadian pharmacy uk delivery
pharmacy price comparison erection pills rx pharmacy
http://essaywriteris.com/ - magic essay writer write my essay generator cheap essay writers can i pay someone to write my essay
GO!!! This phrase was said by the first cosmonaut on Earth - Yuri Gagarin. (Yuri Gagarin) He was the first astronaut on Earth. He was Russian! … Now Russia is becoming a strong country, gas pipelines, a vaccine against COVID-19, an army. Is this very reminiscent of the communist Soviet Union? How do you think? Now we have total control in our country. I am interested in the opinion of foreigners.
ПОЕХАЛИ!!
tadalafil india manufacturers cialis medication cost cialis professional ingredients cialis online purchase tadalafil goodrx cialis 20mg price
tizanidine for gerd tizanidine tab zanaflex with ambien tizanidine mexico tizanidine tablet zanaflex max dosing