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

  • Home
  • SEARCH
  • 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 520441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:08:44+00:00 2026-05-13T08:08:44+00:00

I have a top level widget that is producing a syntax error in python.

  • 0

I have a top level widget that is producing a syntax error in python. raise() on line 15. This is using the python Qt bindings. I know that raise is a python reserved word. I am looking for how to call the Qt “raise()” function with the python bindings.

#!/usr/bin/python

# simple.py

import sys 
from PyQt4 import QtGui

app = QtGui.QApplication(sys.argv)

widget = QtGui.QWidget()
widget.resize(250, 150)
widget.setWindowTitle('simple')
widget.show()
widget.activateWindow ()
widget.raise() 

sys.exit(app.exec_())
  • 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-05-13T08:08:45+00:00Added an answer on May 13, 2026 at 8:08 am

    “raise” is a keyword (reserved word) in Python. So, you can’t use it. And PyQt4 certainly doesn’t use it as you think, because, well, it’s a keyword, so no extension can. It’s like you can’t use “from” for a variable name (pet peeve: Python doesn’t have variables, but I digress…)

    As a hint, it’s also highlighted by the syntax highlighter of SO.

    Just a bit of interactive pythoneering… and it’s raise_. Yep, with an underscore tacked on at the end. Pretty standard method when you have a keyword as a method/function.

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

Sidebar

Related Questions

I have two QTreeWidgetItem that are top level. I want to make the second
I have a top level Verilog module that instantiates a VHDL block with a
I have a top-level page called ReceiveItem . Within that page, I have a
I am using the urllib library to fetch pages. Typically I have the top-level
I'm using backbone js with an xml api data feed. I have a top-level
When I have top-level tree items, should i consider using blank=True , null=True or
I have a top level container (JFrame) that contains two JPanels. One of the
I have a widget specified through a QML file. This widget contains a top
I have a top level menu in my ShellView and when selecting a sub
I have 10 top-level domains e.g. example1.com, example2.com, example3.com, etc, and each domain has

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.