ttc-cases / pydevx-lindjacob

1 stars 0 forks source link

Setup the debugger - and debug the script #5

Closed github-actions[bot] closed 2 months ago

github-actions[bot] commented 2 months ago

[!NOTE] ☝️ Learning goals in this issue

  • Install the debugger in VS Code (revisit)
  • Run to a breakpoint
  • Setup variables to watch
  • Create issues in GitHub on stuff that needs to be done

Start by setting up a development branch for this issue.

Something isn't quite right with the GPT generated code!

Let's debug!

Don't have a debugger? Aaargh - you missed it, we set it up previously but here's another approach you can use: - In the extensions, search for `@category:debuggers Python` Install: - Python - Python Debugger Right-click on each of them and from the context menu add them both to the devcontainer.

Add a breakpoint in line #18 of the rps-game.py script Launch the debugger on the python file

Add the following watches

Now try to answer:

Try to launch the debugger with the launch.json file (You haven't any yet, so the process will create one for your) choose Python Debugger >> Python File with Arguments and type in the argument --hand rock

Now you have a hand ...but it's not always that hand that is played.

Let's keep and share the launch.json file:

git add, commit and deliver to main