The echo append cell magics collected cell text, executed it, and printed "Success!" at the end. You are going to modify that code in a critical way: instead of calling exec on Python code, you are going to call the DOT language executable on DOT language code. The result of that execution should be an image, which you are going to render in the canvas that follows the code cell.
You may face some challenges when addressing this task:
You will need to call an external executable. It is possible that there are Python packages that will interpret DOT code for you -- if you find them, post them in a comment here and we can discuss whether it makes sense to use them.
If, when calling the DOT executable, the code does not compile, you may not know (it depends on how error reporting is handled between the executable, Python, and Jupyter). Before running any code, have two test cases on hand: an example DOT file that you have written and compiled externally and an example DOT file that does not compile. When you end-to-end test your system, copy each of these program into a new notebook (do not put them in the same notebook) to verify the workflow.
If you use the executable, it will probably write the output to disk. This will require naming a file. For now use f'graph_{datetime()}' (or some variation on the timestamp). If there exists a library that processes DOT files, you will likely get the image back in memory as a matrix (e.g., a numpy array type) or an Image object.
The echo append cell magics collected cell text, executed it, and printed "Success!" at the end. You are going to modify that code in a critical way: instead of calling
exec
on Python code, you are going to call the DOT language executable on DOT language code. The result of that execution should be an image, which you are going to render in the canvas that follows the code cell.You may face some challenges when addressing this task:
f'graph_{datetime()}'
(or some variation on the timestamp). If there exists a library that processes DOT files, you will likely get the image back in memory as a matrix (e.g., a numpy array type) or an Image object.