Debugging Console

Learn how to debug a Transcrypt application.

Function mapping

Let’s look at another simple example and examine how the sourcemap that Transcrypt generates can help us with debugging our Python code in the web browser.

Again, like in the previous chapter, we’ll use a Python source file containing a function that we will call from an HTML file opened in a web browser.

Note: Run the below application and open the link only. Then follow the instructions provided below.

def print_stuff():
    console.log("Native JS console.log call")
    print("Python print")
    console.invalid_method("This will be an error")

Demonstrating the mapping capabilities of Transcrypt

Opening developer tools

Before clicking the button to test it first, open up the debugging console in the browser:

  • Google Chrome: Open the menu in the upper-right corner of the browser window and select “More Tools” followed by “Developer Tools”, then select the “Console” tab.
  • Mozilla Firefox: Click on the “Menu” in the browser’s upper-right corner and select “Web Developer” and then “Web Console.” The “Console” tab should be automatically selected.
  • Apple
...