馃悕 Winpdb with Python3

You need to have python2.7 installed. cd /usr/lib/python3/dist-packages/ cp /usr/lib/python2.7/dist-packages/rpdb2.py . Apply patch rpdb2_3.3 --- /usr/lib/python2.7/dist-packages/rpdb2.py 2010-08-17 22:12:52.000000000 +0300 +++ rpdb2.py 2014-05-14 10:37:29.559752856 +0300 @@ -7280,7 +7280,7 @@ Set rpdb2 to wrap all signal handlers. """ for key, value in list(vars(signal).items()): - if not key.startswith('SIG') or key in ['SIG_IGN', 'SIG_DFL', 'SIGRTMIN', 'SIGRTMAX']: + if not key.startswith('SIG') or key in ['SIG_IGN', 'SIG_DFL', 'SIGRTMIN', 'SIGRTMAX', 'SIG_BLOCK', 'SIG_BLOCK', 'SIG_UNBLOCK', 'SIG_SETMASK']: continue handler = signal.getsignal(value) Start Winpdb using python2 Start rpdb2 using python3 python3 /usr/lib/python3/dist-packages/rpdb2.py --debuggee myscript.py Attach the newly created debugger to Winpdb.

May 14, 2014 路 1 min 路 90 words 路 ticapix

鈿狅笍 Tornado API docs with Sphinx: pitfalls

I鈥檝e developed a small RESTful service with Tornado and I wanted to generate docs for the exposed API. Lucky me, someone already thought about it and created the sphinxcontrib.autohttp.tornado addon for Sphinx. The next few tips will help getting the work done: If you鈥檙e using python-3, you need to use this file tornado.py. The latest release 1.2.1 (as of 30/04/2014) doesn鈥檛 work with python-3, because methods = inspect.getmembers(handler, predicate=inspect.ismethod) # returns an empty array with python-3 The predicate needs to be changed to include ismethod or isfunction. ...

April 30, 2014 路 1 min 路 140 words 路 ticapix

馃挕 Blync 2: driving it from the terminal

Following on from the first part of the Blync hack, I want to be able to control the color from a terminal. Let鈥檚 create a simple protocol Command Input in byte Output in byte Default mode 0..7: 0 (AUTO) no output Get current RGB value 0..7: 1 (GET) 0..7: Red as [0..255] 8..15: Green as [0..255] 16..23: Blue as [0..255] Set RGB value 0..7: 2 (SET) 8..15: Red as [0..255] 16..23: Green as [0..255] 24..31: Blue as [0..255] 0..7: 1 (ACK) Here is the demo code in Python using pyserial. ...

March 5, 2014 路 1 min 路 143 words 路 ticapix