Windows process ownership trouble

Am currently being very confused over the following code on Windows import subprocess, os file = open("filename", "w") try: proc = subprocess.Popen("nosuchprogram", stdout=file) except OSError: file.close() os.remove("filename") This produces the following exception: Traceback (most recent call last): File "C:\", line ...

Posted On: Sunday 25th of November 2012 09:15:51 PM Total Views:  370
View Complete with Replies

Related Messages:

help please, splitter windows like in maya or 3ds max   (209 Views)
hi, there, I am doing a 3D modeling project. I like to do it with Python( am a newbie), but have no idea with the wxSplitterWindow to create the 4-view windows( top, front, side, perspective), like the mfc CSplitterWnd guy), anyone can give me some help with wxPython
Re: os.fork() not working on windows (help)   (179 Views)
On 2008-02-25, A. Joseph wrote: > Please i`m trying to create a process using the os.fork() but it keep If you're not trying to clone your current process, just make a new one, you should look at the subprocess module. Ian
Restart crashing modules in windows   (171 Views)
I have a python module that keeps on crashing with various windows errors (not BSOD but the less lethal windows XP popup ones). Now these are intentional and rather sporadic so I cant really solve it by attempting to fix the crash; rather what Im trying to do is make another module outside it that restarts this module every time it crashes. Is this possible How do I do this Or does one windows crash in one python module crash python entirely and I have to resort in an external program to restart python everytime it crashes
daemon under windows   (117 Views)
I wrote a simple UNIX daemon (using 2 forks) which does a simple job: it executes a function, waits for some time, and then executes it again. Now I'd like to port that to Windows. How do I create daemon on Windows (since I can't use fork) -- "Now the storm has passed over me I'm left to drift on a dead calm sea And watch her forever through the cracks in the beams Nailed across the doorways of the bedrooms of my dreams"
can any one tell me where to get graphics module in windows?   (175 Views)
when i type from graphics import * error shown that there is no such module called graphics. help me find this......
How python writes text into another windows application   (267 Views)
I am trying to write a simple program that reads data from a source file (Excel sheet, XML file or text file) and then write the data into another application by pasting the data into the applications fields, and jumps from one field to another by writing \t tab. My question is, how do I write the data into another application fields. My target application is the TNT consignment manager. I asked TNT for their API to make my life easier but they refused to release it . I have a software that uses the same way I am looking after to fill in application fields, it is the QuickAddress. Any idea how to achieve that
RE: howto kill a windows process by name ?   (135 Views)
Take a look at "", in the win32 extension package. - Adam > -----Original Message----- > From: > [] On Behalf > Of stef mientki > Sent: Friday, October 05, 2007 4:40 PM > To: > Subject: howto kill a windows process by name > > hello, > > is there a library to kill a windows process by name > >
newb: glob on windows os.renames creates many nested folders   (204 Views)
when I do this in my python code and run it in windows xp, it creates ctemp/..../.../.../../ so on and creates file t. Not file starting with the name complist and ending with .txt (complist*.txt). Any idea why this may be glob only works in *nix not on windows os.renames(glob.glob('complist*.txt') [0],r'temp/'.join(glob.glob('complist*.txt')[0]))
Resolving windows shortcut to url   (266 Views)
If I have a windows shortcut to a URL, is there a way to get the URL in a Python app I found some code that uses pythoncom to resolve shortcuts to local files, but I haven't found any examples for URLs. The PyWin32 help mentions the PyIUniformResourceLocator Object, but I couldn't find an example of how to use it.
Re: Problem using subprocess.Popen on windows   (192 Views)
On 10/7/07, jorma kala wrote: > from subprocess import * > > p1 = Popen(["dir"], stdout=PIPE) > output = p1.communicate()[0] > > > But I get a WindowsError : [Error 2] File Not Found Tim answered your actual question, but why are you doing this in the first place The Python standard library provides all the functionality that dir will provide and you don't have to parse the output... Look into , and specifically, os.listdir(path). -- Nick
How to do transparent (opaque) windows from Python   (174 Views)
I want to build an application in Python that can show an opaque window so that you can still see and type into any window that it covers. Sort of like a software mylar transparency sheet placed over the screen. I need to be able to type 'through' the transparency into the underlying application, focus remains on the underlying window. My application is assisted typing, but I can envisage other uses such as on-screen rulers. While I would like this to be multi-platform, I need it in MS-Windows. Does anyone know of any Python packages that can do this type of thing
Re: Tabbed windows Support in Python   (104 Views)
On 6/27/07, senthil arasu wrote: > > Currently iam implementing GUI Framework for supporting Tabbed windows to > render different HTML Pages. > A row of tabs facilitated for navigation of pages. > > Iam expecting some classes like "QTabWidget" whick provided by Qt Libarary. > After starting my implementation i came to know Tkinter not supports tabbed > windows > > is there anybody to help me how to proceed further. Do yourself a favor and start off right: use the Dabo framework for your UI. You can get information about it at You can use their Class Designer to create your tabbed windows visually instead of having to write code. -- # p.d.
[Fwd: Re: Trouble killing a process on windows]   (113 Views)
Tim Golden wrote: > Thomas Nelson wrote: [... re problem Terminating process ...] >> File "C:\Python24\warcraft\", line 7, in >> print win32api.TerminateProcess(int(war3game._handle),-1) >> error: (5, 'TerminateProcess', 'Access is denied.') >> >> I'm logged in as adminstrator. Does anyone know ...
how to use subprocess.Popen execute "find" in windows   (137 Views)
In cmd, I can use find like this. C:\>netstat -an | find "445" TCP LISTENING UDP *:* C:\> And os.system is OK. >>> import os >>> os.system('netstat -an | find "445"') TCP LISTENING UDP ...
Odd PyQt4 crash on exit when importing on windows   (165 Views)
Hi all -- I'm having an odd import issue with PyQt4. If I create two files, like so .... --- --------------- from PyQt4.QtGui import * import sys, ybomb app = QApplication(sys.argv) if __name__ == "__main__": main_win = QMainWindow() ...
windows service   (145 Views)
I'm trying to get a program that uses M2Crypto ThreadingSSLServer to run in windows as a service. I have a few problem, it doesn't listen on its port and I don't know how to debug it. I used the pipeservice ...
Re: socket-module: different behaviour on windows / unix when atimeout is set   (165 Views)
En Wed, 09 Jul 2008 15:02:56 -0300, Mirko Vogt escribi: > it seems that the socket-module behaves differently on unix / windows > when a timeout is set. [...] > Now I will change the code slightly - to ...
Boa: howto make child windows really child   (136 Views)
i just started using Boa constructor, but, i dont like child windows floatin,g on my desktop. how can i make all child windows of boa all together, docked in one parent boa window... i found in preferences, general, childFrameStyle, i ...
Alternative to python -u for binary upload to cgi on windows?   (131 Views)
Hi all, Using a python cgi script such as the one below to handle uploaded binary files will end up with a truncated file (truncates when it hits ^Z) on Windows systems. On linux systems the code works and the ...
socket-module: different behaviour on windows / unix when a timeoutis set   (160 Views)
, it seems that the socket-module behaves differently on unix / windows when a timeout is set. Here an example: # import socket sock=socket.socket(socket.AF_INET,socket.SOCK_STREAM) print 'trying to connect...' sock.connect(('',9999)) print 'connected!' # executed on windows >C:\Python25\python.exe trying to ...