473,383 Members | 1,815 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,383 software developers and data experts.

threaded code in IDLE

This code:

**************
import thread

def doprint(i):
print i

for i in range(0,100):
thread.start_new_thread(doprint,(i,))
*************

Will run fine from the windows command line, but consistently
crashes IDLE on windows (it locks up with no error message)

Is this a known bug?

Is there a workaround?

Thanks,
Matt
Jul 18 '05 #1
1 1486
Matt Leslie <ma***********@hotmail.com> writes:
This code:

**************
import thread

def doprint(i):
print i

for i in range(0,100):
thread.start_new_thread(doprint,(i,))
*************

Will run fine from the windows command line, but consistently
crashes IDLE on windows (it locks up with no error message)

Is this a known bug?


Which IDLE? Which Python? Which Windows?

Works for me on Windows2000, Python 2.3.2, Idle 1.0
If I run a thousand threads IDLE uses over 64MB unless I add a little
delay in between spawning threads. Using the Python interpreter, not
IDLE, I can add a time.sleep(.0000015) and get away with 10,000
threads piling up with output to print. IDLE needs more time, try .01
sec and watch your Task Monitor. (Though 100 threads isn't much of
a load....)

--
KBK
Jul 18 '05 #2

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

Similar topics

16
by: Kerry Neilson | last post by:
For the past couple of months, Idle won't start when I invoke it. I am at a complete loss for why this is. When this happens, they python command line still starts, and python works fine...
1
by: Moosebumps | last post by:
So say I am working on two separate .py files in IDLE that are part of the same program. Does anyone have problems where when you modify one file, and then run the other, the changes you made in...
1
by: dbrown2 | last post by:
I typically use IDLE for editing and debug. On Windows at least, IDLE and the standard turtle graphics module do not mix. I think both use Tkinter. For now I use IPython and Jedit when using...
8
by: Jonathan Polley | last post by:
I have one account on a WindowsXP machine that refuses to run IDLE (or any other python script that uses Tk). Other people can login to that PC and IDLE runs just fine, so it is not an...
1
by: BergRD | last post by:
Salutations! New to the forums but have gotten many an idea from lurking over the past few months but alas it's time to begin positing; posting to a problem I cannot seem to resolve. This is a...
20
by: dotyet | last post by:
Hi Everyone, It would be a real big help if anyone can shed light on whether DB2 UDB 8.2 on Solaris will make optimum use of a Sun T2000 server. The server has 1 CPU with 8 cores and each core...
5
by: dbandler | last post by:
I'm trying to use ftp in python in a multi-threaded way on a windows box - python version 2.4.3. Problem is that it appears that it's only possible to have five instances/threads at one point in...
12
by: John | last post by:
I want to do something like this: for i = 1 in range(0,N): for j = 1 in range(0,N): D = calculate(i,j) I would like to now do this using a fixed number of threads, say 10 threads. What is...
5
by: Russ P. | last post by:
I've been programming in python for a few years using XEmacs on Solaris and Linux. I've been thinking about trying IDLE for a long time, but either it wasn't available on my system or I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.