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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:57:50+00:00 2026-05-24T01:57:50+00:00

Currently I try to create an unit test which opens a file (with the

  • 0

Currently I try to create an unit test which opens a file (with the corresponding application) and then the test-run should wait until the program is closed.

def test_HFG(self):
#....
print "please edit this file"
os.chdir(r'C:\test\a')
os.startfile("myfile.vdx")
# here I need a "stop until the program is closed"-function
#....

Does anyone have any idea how to realize(as simple as possible) my plan?

  • 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-24T01:57:52+00:00Added an answer on May 24, 2026 at 1:57 am

    From the docs:

    startfile() returns as soon as the associated application is
    launched. There is no option to wait for the application to close, and
    no way to retrieve the application’s exit status.

    If you know the path of the application to open the file with, you could use subprocess.Popen() which allows for you to wait.

    See:
    http://docs.python.org/library/os.html#os.startfile

    http://docs.python.org/library/subprocess.html#subprocess.Popen

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

Sidebar

Related Questions

I currently try to create classes for a paint-like WPF application. I have to
I currently try to create classes for a paint-like WPF application. I have to
I am currently fiddling around with Node.JS to try to create a package for
When I create new NUnit unit tests in my test project, the ReSharper Unit
currently i try to create a push server instance for new activities around our
I am attempting to create a simple database application which keeps track of loans
procedure TMainForm.FormDestroy(Sender: TObject); var Registry: TRegistry; begin Registry := TRegistry.Create; try Registry.RootKey := HKEY_CURRENT_USER;
I'm currently (I try to) designing a RESTful API for a social network. But
I currently have MVS2008 and I want to try the 2010 version hoping that
I'm currently working with PHPUnit to try and develop tests alongside what I'm writing,

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.