I am using py.shell as console in one of my gui applications. There are two
option to execute a script in this console.
One is shell.run("execfile(fileName)",False,False) . This displays output on
console.
But I want to display script also along with output.
When I want to run a script with script displaying in the console of a
shell , I am using shell.runfile(filename). But in this case, there is a
problem. In certain cases the execution of this command displays indentation
errors on the console.
As the file is a mix of source + commands. If I eliminate the blank
lines in source like class definition then if the script contains only that
class and few commands then it is working fine.
But this is not the case for all the scripts where in I can have classes
and commands but as they are getting pushed to the console , if there is no
blank line between class and command/another source(if/while loop) it is
considering as continuos source and throwing indentation errors.
Is any one having a solution or patch?
Thanks,
Madhubala
Regards,
Madhubala
|