Skip to content

Comment on PyScript: Run Python in your HTMLparent

Comments

As a way of interacting with the DOM, this makes me very uncomfortable:

    # add the task element to the page as new node in the list by cloning 
    taskHtml = task_template.clone(task_id, to=task_list)
    taskHtmlContent = taskHtml.select('p')
    taskHtmlContent.element.innerText = task['content']
    taskHtmlCheck = taskHtml.select('input')
    task_list.element.appendChild(taskHtml.element)

We can surely make such things easier in 2022?

I imagine that if Python were supported out of the box in browsers like JavaScript is, frameworks would emerge for this sort of thing. At this point though, I'm not sure I think it's particularly likely that browsers will support additional languages instead of just preferring people compile to WASM and use some JavaScript over it.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.