Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13921

Output line of code while executing it in Python

$
0
0

I am developing a small program which I want to give to my younger friends to introduce them to the bare minimum basics of programming using Python.In it, I want to add functionality to output the line of code that is being executed, as it is being executed, to the console (or as a variable within Python that can be printed using suitable commands).I want this so that users of this program may learn better by understanding the underlying process that is going on real time, at the higher level (programming language execution).I thought this would be possible especially because Python is an interpreter language, so the code is playing part until the penultimate step of executing it.

Is there any way to do this intrinsically? If not, I think there should be a way to write a program that will​ take another program as input and execute while also having access to source code. With some advanced parsing, that kind of design will be able to achieve this, but I'm looking for preferably a more natural way to do this.


Viewing all articles
Browse latest Browse all 13921

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>