Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Call seq

463 views

Published on

Introduce to call_seq which is a tool to help you trace code efficiently.

Published in: Software, Technology
  • Be the first to comment

  • Be the first to like this

Call seq

  1. 1. Introduce to call_seq A tool to help you trace code efficiently. 果凍
  2. 2. What is it? ● Apache License Version 2.0 ● A tool to help you trace code efficiently. ● It record the program how to run and save the result to file with json format. ● You can use `python -m call_seq.browser output.json` to read the program how to run. ● https://github.com/ya790206/call_seq
  3. 3. How to install it? pip install call_seq pip install pyside pyqode.core pyqode.python it’s not simple thing if you use pip to install pyside. Make sure you have installed qt dev package.
  4. 4. How to use it? if __name__ == '__main__': map = CallSeq() map.set_trace() test() map.unset_trace() map.dump_to_file('output.json')
  5. 5. How to use it? @trace('output.json') def main(): test()
  6. 6. How to use it? if __name__ == '__main__': with CallSeq(name='output.json'): test()
  7. 7. How to use it? $ python -m call_seq.core output.json demo1. py
  8. 8. How to use the file the tool generate? $ python -m call_seq.browser output.json
  9. 9. Source code is displayed here. function `default_hook` is defined here. The line is marked with gray. We can know that the function `__init__` call `default_hook` and store result in `self.hooks` We can know that `default_hook` return in line 24. The value of return is a dict with key `response`. We can know the function get no arguments. It’s clear.
  10. 10. Enjoy it Thank you for reading.

×