Python Debugging

Main.PythonDebug History

Hide minor edits - Show changes to output

Added lines 1-28:
(:title Python Debugging:)
(:keywords debug, error, warning, crash, Python, fix, step, iPython, workspace, variable, teach:)
(:description Introduction to debugging in Python with examples on how to local both syntax and logical errors.:)

Debugging in any programming language typically involves two types of errors: syntax or logical. Syntax errors are those where the programming language commands are not interpreted by the compiler or interpreter because of a problem with how the program is written. These types of errors cause the program to either stop at the offending code or give a warning or error when the program execution is attempted. Once all of the syntax errors are discovered and corrected, logical errors still allow the program to run to completion but give incorrect results. Logical errors can be corrected by testing multiple conditions to check the correct operations or output of the program. Debugging in Python can either involve '''print''' statements or a more sophisticated debugger interface such as Spyder or ipdb.

<iframe width="560" height="315" src="" frameborder="0" allowfullscreen></iframe>

 <div id="disqus_thread"></div>
    <script type="text/javascript">
        var disqus_shortname = 'apmonitor'; // required: replace example with your forum shortname

        /* * * DON'T EDIT BELOW THIS LINE * * */
        (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = 'http://' + disqus_shortname + '';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    <noscript>Please enable JavaScript to view the <a href="">comments powered by Disqus.</a></noscript>
    <a href="" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>