The debugger is here to only show you what your code is doing and your task is to compare with what it should do. Pdb – Interactive Debugger - Python Module of the Week pdb - The Python Debugger - Python 3.6.1 documentationĭebugging in Python | Python Conquers The Universe Mastering Debugging in Visual Studio 2010 - A Beginner's Guideīasic Debugging with Visual Studio 2010 - YouTubeĢ7.3. To see what your code is doing: Just set a breakpoint and see your code performing, the debugger allow you to execute lines 1 by 1 and to inspect variables as it execute.ĭebugger - Wikipedia, the free encyclopedia When the code don't do what is expected, you are close to a bug. There is no magic in the debugger, it don't know what your code is supposed to do, it don't find bugs, it just help you to by showing you what is going on. The debugger is here to show you what your code is doing and your task is to compare with what it should do. In our example it return array of bytes for a given string str. There is an almost universal solution: Run your code on debugger step by step, inspect variables. 2.join () and bytearray () to convert string to binary in Python In this example, we are using the bytearray () function that returns an array of bytes. Your code do not behave the way you expect, or you don't understand why ! Read this page and pay attention to "Return Values" and "Recursion": Python Functions # Because of print(dec_to_binary( 145)) # -> 10010001 # and print(binary_to_dec( " 1111")) # -> 15 # you need to define functions with "return values" instead of print the partial result
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |