[Tutor] close failed in file object destructor:
bob gailer
bgailer at gmail.com
Wed Oct 19 19:05:20 CEST 2011
On 10/19/2011 11:50 AM, Navneet wrote:
>
> Thank you Bob and Dave,
> Yes the file is as you expected,
I don't understand that comment.
> I thought it is easy to figure out that you have to change the file
> location in program
Don't make that assumption. Of course we can figure that out, but you
should use something like <pathname> that is obviously to be replaced
rather than an invalid filename.
>
> Problem:I am trying to find prime numbers from a file which contains a
> list of number and each thread(say 5) is suppose to work on different
> number, in short I am applying round-robin method via thread.
What does (say 5) mean? Your program will start
>
> I'll try one more time
> BTW I have attached the file :D
Please don't attach large files. All I wanted was a sample.
We will await your next attempt.
Fix the program, Run it. If you don't get the desired results think
about why, then either continue fixing or post a new program with a new
question.
Did you think about all the questions I asked. I did not see any
answers. I repeat them here. Please answer.
* Why did you use a class? You don't need it, and it complicates things.
* Why put some of the code in the mainline of the class and some in
__init__. I see no need for that separation.
* Since you use print statements to monitor progress how about addind
something so you know which print statement was called. Perhaps
print "I am here 1", print "I am here 2", etc.
* Why have the file at all? Why not just start with c = range(1,1000)?
* Why print the entire list? (print c)?
--
Bob Gailer
919-636-4239
Chapel Hill NC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111019/08657c26/attachment.html>
More information about the Tutor
mailing list