question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to Call JavaScript Objects, Functions or Global Variables From Python Side?

See original GitHub issue

Specification

  • pywebview version: 3.5
  • operating system: Windows 10
  • web renderer: any

Description

Sometime we need to access objects, functions or valuables from Javascript side. Is there a way to do it? Right now it seems webview.window.evaluate_js() is the only way to comunicate with JS.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
XieBcommented, Jun 29, 2022

it work well. But i notice that it is low performance when i try call javascript from python side on windows. javascript always return something can resolve it like this image thanks a lot

0reactions
martinlombanacommented, Oct 6, 2022

With current published version, I confirm there is still a delay if I do not put a return in the js version.

El El jue, 6 oct 2022 a las 9:24, Roman @.***> escribió:

@martinlombana https://github.com/martinlombana You can try removing the delay and see if it still works. I have spent a fair time of resolving deadlocks back in the day and this delay was added to resolve one of deadlocks. I don’t remember details, so as mentioned it may be the case it is no longer needed.

— Reply to this email directly, view it on GitHub https://github.com/r0x0r/pywebview/issues/777#issuecomment-1269479620, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMAOLZY4EXADXTSSAWUFO3WBZ5D7ANCNFSM5DL4M4FQ . You are receiving this because you were mentioned.Message ID: @.***>


Martín Lombana

(+34) 633 63 02 35 *TODOLOGIC.COM https://todologic.com APPS & MORE *

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accessing variables from other functions without using global ...
Return the value you wish to use in functionOne, then call functionOne within functionTwo, then place the result into a fresh var and...
Read more >
Global Variable in Python With Examples [Updated] | Simplilearn
A global variable in Python means having a scope throughout the program. Understand how to create and access global variables with examples.
Read more >
Programming FAQ — Python 3.11.1 documentation
How do I share global variables across modules? What are the “best practices” for using import in a module? Why are default values...
Read more >
How to Use Global Variables Inside a Python Function?
Article Link: https://blog.finxter.com/how-to-use- global - variables -in-a- python - function / ...
Read more >
Javascript Tutorial to Access Global Variables Using Window ...
Javascript Tutorial to Access Global Variables Using Window,this,Self,Frames & GlobalThis Object # javascript #programming #codingVisit my ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found