displaying execution of Python code

N

noahwatkins

I'll start my question by describing my desired result. I will
construct a GUI which will be used to open a Python script. I would
then like to be able to display the Python script, execute it, and
highlight the lines of the Python as they are executing.

More technically, I am looking for direction on where to start looking
in the Python libraries for a functionality that will allow me to
execute arbitrary Python code from within a Python application.
Additionally, I need to be able to have the ability to get information
and perform actions (e.g. line number currently executing) as the code
executes.

Thanks,
Noah
 
S

Stef Mientki

noahwatkins said:
I'll start my question by describing my desired result. I will
construct a GUI which will be used to open a Python script. I would
then like to be able to display the Python script, execute it, and
highlight the lines of the Python as they are executing.

More technically, I am looking for direction on where to start looking
in the Python libraries for a functionality that will allow me to
execute arbitrary Python code from within a Python application.
Additionally, I need to be able to have the ability to get information
and perform actions (e.g. line number currently executing) as the code
executes.

Thanks,
Noah
start with the wxPython demo, I guess you find all you need in there.
cheers,
Stef
 
G

Gabriel Genellina

More technically, I am looking for direction on where to start looking
in the Python libraries for a functionality that will allow me to
execute arbitrary Python code from within a Python application.
Additionally, I need to be able to have the ability to get information
and perform actions (e.g. line number currently executing) as the code
executes.

See the trace module and the sys.settrace hook.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top