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 7815413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:30:53+00:00 2026-06-02T05:30:53+00:00

I am a behavorial scientist and usually collect data by letting participants do some

  • 0

I am a behavorial scientist and usually collect data by letting participants do some tasks on a computer and record their responses (I write the programs using the pyglet wrapper PsychoPy). That is, the program runs locally and the data is stored locally.

Now I would like to know if there is a way to use Python to display a (local) website with html-forms to the user and collect the input (locally). The reason for this idea is that currently whenever I want to display checkboxes, radiobuttons, or input fields I use wxPython. This works quite well, but programming and layouting in wxPython is kind of cumbersome and I would prefer html with forms.

A requirement would be that it would need to rum without any borders, adress field, menu bar, … The reason is that I need it in kind of fullscreen mode (I currently open a non-fullscreen pygflet window in the size of the screen to hide the desktop) so that participants can do nothing but work on the forms.

So I am looking for a way to (a) display html websites including html form above a pyglet window with no menu bar or whatsoever, (b) collect the input when clicking on the Ok button (i.e., the form is send), (c) control what is presented prior and after viewing this website, and (d) everything of this should happen locally!

My idea would be that the data is collected when participants hit the “Send away” button in the following example pic and the next page is displayed.

example form

Update: I use windows (XP or 7).

  • 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-02T05:30:57+00:00Added an answer on June 2, 2026 at 5:30 am

    This is a solution using Qt Webkit for rendering HTML. The default navigation request handler is wrapped by a function that checks for submitted form requests. The form uses the “get” method, so the data is included in the url of the request and can be retrieved that way. The original request is declined and you can change the content of the displayed web page as you wish.

    from PyQt4 import QtGui, QtWebKit
    
    app = QtGui.QApplication([])
    view = QtWebKit.QWebView()
    
    # intercept form submits
    class MyWebPage(QtWebKit.QWebPage):
        def acceptNavigationRequest(self, frame, req, nav_type):
            if nav_type == QtWebKit.QWebPage.NavigationTypeFormSubmitted:
                text = "<br/>\n".join(["%s: %s" % pair for pair in req.url().queryItems()])
                view.setHtml(text)
                return False
            else:
                return super(MyWebPage, self).acceptNavigationRequest(frame, req, nav_type)
    view.setPage(MyWebPage())
    
    # setup the html form
    html = """
    <form action="" method="get">
    Like it?
    <input type="radio" name="like" value="yes"/> Yes
    <input type="radio" name="like" value="no" /> No
    <br/><input type="text" name="text" value="Hello" />
    <input type="submit" name="submit" value="Send"/>
    </form>
    """
    view.setHtml(html)
    
    # run the application
    view.show()
    app.exec_()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got some strange behavioral differences between Python's subprocess.call() and os.system() that appears to
I am trying to embrace TDD and started learning about mocking. I need some
Recently i'm using VHDL to write a 16-but RAM. My code is: library IEEE;
I am noticing a weird behavioral on some pages with flash file that loads
When I write tests for certain types of objects, such as UI elements like
I'm trying to synthesize some code I've found which essentially converts an 8-bit binary
Looking for some practical advice here and any experiences people have had in a
I am assigned with the task of verifying some verilog based RTL code. Now,
Some of us in my company are arguing about it. Given a source code
I did a behavioral simulation of my code, and it works perfectly. The results

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.