CCExtractor Development

(VII) [winnerstrack] Python: Advanced Python debugger

This task should only be done if you've done the previous 6 in the series.

On the last task we were able to generate a .json file that describes the program flow - the steps, and what happens at each step.

We're going to use this .json file (and the source code) to generate a video file that shows the program as it runs.

This is your job:

  • Add a option -video to your debugger that takes the source code of the program being debugger, the .json file from the program execution and generates a video file that shows the program flow.

The video must contain two parts: To the left, display the source code, with the line just executed in a different color. Also display the number of times that line has been executed and the time spent on it so far.

To the right, the variables: Display in the different color the last modified variable as well as the current and previous values.

For the video generation itself you can use any library. You may need to use two libraries actually, one to compose each frame (this would be a graphics library that gives you a canvas and lets you add text to it) and another for the video, for example a .mp4 library. But it's really up to you to come up with a good solution.

As always, upload to github and send us a link to the repo.

Task tags

  • python
  • debugger
  • winnerstrack

Students who completed this task

Knob, kdrag0n, AlephZero, knightron0, Techno-Disaster, Tantan4321

Task type

  • code Code