Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8599173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:20:10+00:00 2026-06-12T01:20:10+00:00

For an application I am currently working on I decided to use HTML5 for

  • 0

For an application I am currently working on I decided to use HTML5 for the interface, allowing me to have a modern interface that doesn’t change in appearance when you change operating systems. Naturally I chose the webkit engine for rendering, specifically the PyQT bindings. My issue is that every time I want to call a javascript function from python, I have to do it using the messy evaluateJavaScript function.

Any alternatives I can use that allow a more direct way of calling javascript functions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:20:12+00:00Added an answer on June 12, 2026 at 1:20 am

    PyQt doesn’t have any wrapper that makes things easier.

    You could write your own, if you want—not perfect, but a little nicer. For example, something like this (just a skeleton, not actual code):

    class JSObject(object):
        def __init__(self, name):
            self.name = name
        def __getattr__(self, attr):
            class Proxy(object):
                def __init__(self, objname, funcname):
                    self.name = '%s.%s' % (objname, funcname)
                def __call__(self, *args):
                    argstr = ', '.join(json.dumps(arg) for arg in args)
                    retstr = evaluateJavaScript('%s(%s)' % (self.name, argstr)
                    # realistically you may want to do more to parse the return
                    # value—e.g., look up/create JSONObjects as needed?
                    return json.loads(retstr)
            return Proxy(self, attr)
    
    thingIWantToCall = JSObject('thingIWantToCall')
    print thingIWantToCall.methodIWantToCallOnIt('foo', [1, 2, 3])
    

    As you can see, it’s still a bit clumsy—you have to manually create the object proxies, and there’s no way to call free functions or declare variables or anything other than call methods on objects. Some of that could be implemented, but there’s a limit to how far you can go. (Of course you can always fall back to explicit strings.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a web application and the powers above have decided that
I am currently working on a ASP.NET AJAX application. Having decided to not use
I am currently working on a GWT application that requires report printing. The use
We are currently working on the design of a RESTful application. We have decided
Am currently working on an application that requires users to submit posts and comments
I am currently working on MVC4 SinglePage Application. I have a Web Api method
I'm currently working in an application that has to navigate a webpage and recollect
I am currently working on an application that has different permissions/users for the local
I'm currently working with C# and developing a few Silverlight applications that use sharepoint
I currently have an application that contains user statuses and support for comments on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.