Re: using print() with multiprocessing and pythonw

2013-11-12 Thread Isaac Gerg
Thanks for the reply Bill. The problem is the text i am getting is from a python warning message, not one of my own print() function calls. -- https://mail.python.org/mailman/listinfo/python-list

using print() with multiprocessing and pythonw

2013-11-12 Thread Isaac Gerg
I launch my program with pythonw and begin it with the code below so that all my print()'s go to the log file specified. if sys.executable.find('pythonw') >=0: # Redirect all console output to file. sys.stdout = open("pythonw - stdout stderr.log",'w') sys.stderr = sys.std

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Isaac Gerg
Hi Piet, Here is a real code example: http://stackoverflow.com/questions/948119/preventing-file-handle-inheritance-in-multiprocessing-lib As I said before, I had provide pseudocode. I cannot close the file after reading because it is part of a class and other threads may be calling member func

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Isaac Gerg
On Thu, Oct 10, 2013 at 2:49 PM, Isaac Gerg wrote: > > > > On Thu, Oct 10, 2013 at 2:41 PM, Ned Batchelder wrote: > >> On 10/10/13 12:44 PM, Isaac Gerg wrote: >> >>> Sorry, I am just providing pseudo code since I the code i have is quite >>> large

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Isaac Gerg
On Thu, Oct 10, 2013 at 2:41 PM, Ned Batchelder wrote: > On 10/10/13 12:44 PM, Isaac Gerg wrote: > >> Sorry, I am just providing pseudo code since I the code i have is quite >> large. >> >> As I mentioned, the code works fine when I remove the multirpcessing >&

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Isaac Gerg
example here: http://stackoverflow.com/questions/948119/preventing-file-handle-inheritance-in-multiprocessing-lib None of the solutions posted work. On Thursday, October 10, 2013 12:38:19 PM UTC-4, Piet van Oostrum wrote: > Isaac Gerg writes: > > > > > I have a function t

Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Isaac Gerg
I have a function that looks like the following: #- filename = 'c:\testfile.h5' f = open(filename,'r') data = f.read() q = multiprocessing.Queue() p = multiprocess.Process(target=myFunction,args=(data,q)) p.start() result = q.get() p.join() q.close() f.close() os