- 1). Launch a command line terminal interface on your computer and access the folder that contains the Python script you want to debug by typing "cd" followed by the directory path where the script is located.
- 2). Type the following commands (replacing "examplemodule" with the name of the Python module that you wish to debug):
import pdb
import examplemodule - 3). Type the following command to run the debugging tool and locate the source of the error:
pdb.run('examplemodule.test()') - 4). Examine the output that's displayed in the command line window after running the command in the previous step to see what parts of your Python code are causing the restarts.
- 5). Open your Python script in a text editing application and search its code for the commands "restart" and "run." Ensure that they are not erroneously placed in your code.
SHARE