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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:28:31+00:00 2026-05-22T17:28:31+00:00

Two files. Each runs new window and works by itself. I need to run

  • 0

Two files. Each runs new window and works by itself. I need to run them both.
When I run first.pyw, only one (second) window is shown.

Is it possible two run them both?

first.pyw:

import sys
from PyQt4.QtGui import *
import second

class first(QWidget):
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        self.setWindowTitle('first')

app = QApplication(sys.argv)
firstApp = first()
firstApp.show()
sys.exit(app.exec_())

second.pyw:

import sys
from PyQt4.QtGui import *

class second(QWidget):
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        self.setWindowTitle('second')

app2 = QApplication(sys.argv)
secondApp = second()
secondApp.show()
sys.exit(app2.exec_())

How can I run two applications that are in different modules?

  • 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-22T17:28:32+00:00Added an answer on May 22, 2026 at 5:28 pm

    You can only run a single application at a time, although your application can have multiple top-level windows. The QCoreApplication docs say that:

    …there should be exactly one QCoreApplication object.

    This also holds true for QApplication as it derives from QCoreApplication. You can get access to that application through the QCoreApplication.instance() method or the qApp macro in C++.

    What do you expect to get out of having two different applications running? Instead, you could have each module provide a top-level window that then gets displayed by the application launcher.

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

Sidebar

Related Questions

I have two CSV files which use @ to divide each column. The first
I have two files independant on each other. Let's just call it Class1 and
i have two files:(localhost/template/) index.php template.php each time when i create an article(an article
I have two files A - nodes_to_delete and B - nodes_to_keep . Each file
I have two 3GB text files, each file has around 80 million lines. And
I created two files in the App_GlobalResources folder: SiteResources.en-US.resx SiteResources.sp-SP.resx Both contain a value
I have large data in two files each with about two million (different) entries.
I have a file in which each line contains two numbers. The problem is
In the file there are 9 dictionaries each with two keys. I want to
I have two perforce clients (client-a, client-b) that each contain about 40 file specs.

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.