Skip to content

No Python output if console.log() is called after Python code #712

@marimeireles

Description

@marimeireles

Checklist

  • I added a descriptive title
  • I searched for other issues and couldn't find a solution or duplication
  • I already searched in Google and didn't find any good information or help

What happened?

Working on #622 I found a problem that I think it's coming from upstream pyscript.py.
When you add a js print after python code that should be printing in the screen, nothing is printed. To reproduce try the following snippet:

from datetime import datetime
now = datetime.now()
now.strftime("%m/%d/%Y, %H:%M:%S")
console.log("this is coming from js")

The string "this is coming from js" shows up in the console normally, but the python output in the page remains empty.
E.g using the hello_world example, this is all I see in my screen:

Hello world!
This is the current date and time, as computed by Python:

I'm exploring this, but feel free to add thoughts if you have any!
Thanks!

What browsers are you seeing the problem on? (if applicable)

Firefox, Chrome

Console info

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogissue has been triaged but has not been earmarked for any upcoming releasetype: featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions