473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

os.wait() for Windows

Hello,

I am new to python. I am using the os module to run a command in a
bashshell. However I need this process to complete before continuing. Is
there a command that will wait for this process to complete? I am using
Windows XP and the os.wait() command only works for UNIX systems, and
therefore doesn't work.

My code is as follows:

import os
FileName = raw_input('Enter the file name: ')
os.system('abaqus job=FileName')
resultsFile = open('FileName.dat','r')

Abaqus will take a few minutes to complete and create the associated results
file. However once I run this code I get the following error ... "IOError:
[Errno 2] No such file or directory: 'FileName.dat'" ... as the file does
not exist yet. Is there any way of waiting for the job to complete before
continuing?

I'd appreciate any help.

__________________________________________________ _______________
Share folders without harming wildlife!
http://www.communicationevolved.com/en-ie/

Mar 20 '07 #1
1 8572
On Mar 20, 10:32 am, "Damien Byrne" <damobyrne2...@hotmail.comwrote:
Hello,

I am new to python. I am using the os module to run a command in a
bashshell. However I need this process to complete before continuing. Is
there a command that will wait for this process to complete? I am using
Windows XP and the os.wait() command only works for UNIX systems, and
therefore doesn't work.

My code is as follows:

import os
FileName = raw_input('Enter the file name: ')
os.system('abaqus job=FileName')
resultsFile = open('FileName.dat','r')

Abaqus will take a few minutes to complete and create the associated results
file. However once I run this code I get the following error ... "IOError:
[Errno 2] No such file or directory: 'FileName.dat'" ... as the file does
not exist yet. Is there any way of waiting for the job to complete before
continuing?

I'd appreciate any help.

__________________________________________________ _______________
Share folders without harming wildlife!http://www.communicationevolved.com/en-ie/

I would recommend subprocess.call(programToRun) or
subprocess.Popen(programToRun).wait()

Mike

Mar 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Chang LI | last post by:
I tried to launch "python.exe test.py" in another program. After the launch the console was showed and exited on Windows. I want the console stay there. Is there a Python statement to wait an event...
25
by: BOOGIEMAN | last post by:
I've just finished reading Python turtorial for non-programmers and I haven't found there anything about some usefull commands I used in QBasic. First of all, what's Python command equivalent to...
4
by: GTi | last post by:
Hello... I have a page located in a frame. This page contains a form. When the user submit this form I want to popup a "Please Wait" window popup window The post may take some time for the...
7
by: Alex007 | last post by:
Hi, I've been working on this C assignement for a CS course.... the assignement is going pretty well and all my code works well on both Windows and Linux. The only thing that doesn't work is...
4
by: Pierpaolo | last post by:
hi!! Is there a function in order to wait for a time in milliseconds?? Thanks in advance
2
by: Bill Nguyen | last post by:
below is the error message I received when about 2/3 of the process is done. Where in my code I sould look for? Thanks Bill --------- The CLR has been unable to transition from COM context...
4
by: Eddie | last post by:
I am opening a windows (well, technically a greybox() call GB_show() which shows a nicer window than normal), and want to wait until that window is closed before moving to the next command. ...
40
by: =?Utf-8?B?Um9iZXJ0IEUuIEZsYWhlcnR5?= | last post by:
What is the C# command to wait for a specified period of time? I am writing a windows service that will process a file once it has beed created or changed. I'm using the fileSystemWatcher to...
2
by: DKn | last post by:
Hello All, I am doing one C#.net windows application. At the time of loading the form , some operations need to be done, so it will take time( one or two minutes) to load the form. At this time,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.