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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:36:59+00:00 2026-06-18T06:36:59+00:00

I have installed PyQt 4 for use with Python33 on my windows 7 machine,

  • 0

I have installed PyQt 4 for use with Python33 on my windows 7 machine, I followed the instructions on riverbank and everything seems to have be done correctly, however, I tried a simple example to create a basic found online, which compiled but doesnt display any GUI. any ideas?

import sys
from PyQt4 import QtGui

def main():

    app = QtGui.QApplication(sys.argv)

    w = QtGui.QWidget()
    w.resize(250, 150)
    w.move(300, 300)
    w.setWindowTitle('Hello')
    w.show()

    sys.exit(app.exec_())

Thanks

  • 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-18T06:37:00+00:00Added an answer on June 18, 2026 at 6:37 am

    You simply defined a function. You must also call it to see the widget:

    I have installed PyQt 4 for use with Python33 on my windows 7 machine, I followed the instructions on riverbank and everything seems to have be done correctly, however, I tried a simple example to create a basic found online, which compiled but doesnt display any GUI. any ideas?

    import sys
    from PyQt4 import QtGui
    
    def main():
    
        app = QtGui.QApplication(sys.argv)
    
        w = QtGui.QWidget()
        w.resize(250, 150)
        w.move(300, 300)
        w.setWindowTitle('Hello')
        w.show()
    
        sys.exit(app.exec_())
    
    
    if __name__ == '__main__':  #avoids execution when imported.
        main()
    

    Launching the program with $python the-program.py should show the window.

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

Sidebar

Related Questions

I have installed msysGit 1.7.10 on my Windows 7 machine. What I need to
I have installed a C# windows forms app on a client machine which does
I have installed MinGW in Windows Vista, so I can use gcc but it
I have installed 3.3.0 python installer in windows. Then I want to install MySQLdb.
I have installed MySQL locally and I am trying to use it as a
I have installed the latest MSysGit 1.6.3 preview and TortoiseGit 0.6.2 on my Windows
I have installed a C# Windows Service on Windows Server 2008. I installed it
I have installed Glassfish application server Openshift cloud servers. I can only use :8080
I have installed the ODAC 11 and I would like to use it with
I have installed Visual Studio 2012 (aka 11) and uninstalled 2010. However I noticed

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.