[Tutor] Debugging in Python

Chris Warrick kwpolska at gmail.com
Mon Nov 16 10:42:32 EST 2015


On 16 November 2015 at 15:43, Alan Gauld <alan.gauld at btinternet.com> wrote:
> Thats not an IDE its just a raw interpreter.
> IDLE is a full IDE that includes a debugger.

It’s an awful piece of garbage that pretends to be an IDE.

>> I encountered some error in the source , then I fixed it and tried to run
>> the module with the above snippet again , but the the error prevails even
>> though the error part is commented and the updated version saved.
>
>
> You need to reload the module but sadly there is no simple command to do
> that in the interpreter. There is in IDLE ("Restart Shell" menu item)
>
> So if you use IDLE your issues will be resolved. You can install
> IDLE3 from the Ubuntu package manager.

No, they won’t. They will be replaced by a much worse and less
friendly IDE. Please don’t bother installing IDLE and use the normal
`python3` shell, ipython or bpython.

The correct fix is to exit() from the python3 shell and start it again.
Alternatively, add some main code at the end of your file and use
`python3 hlibert.py`:

if __name__ == '__main__':
    hilbert(3)

-- 
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16


More information about the Tutor mailing list