Re: How to run an infinite loop on Menu?

2018-12-03 Thread Peter Otten
huey.y.ji...@gmail.com wrote: > Hi Folks, > > I need to run an infinite loop on a Menu button, like this: > > from Tkinter import * > > def run_job(): > i = 0 > while 1: > i = i + 1 > if i > 100: > break > .

Re: How to run an infinite loop on Menu?

2018-12-03 Thread Thomas Jollans
On 03/12/2018 08:58, huey.y.ji...@gmail.com wrote: > Hi Folks, > > I need to run an infinite loop on a Menu button, like this: > > from Tkinter import * > > def run_job(): > i = 0 > while 1: > i = i + 1 > if i > 100: >

How to run an infinite loop on Menu?

2018-12-03 Thread huey . y . jiang
Hi Folks, I need to run an infinite loop on a Menu button, like this: from Tkinter import * def run_job(): i = 0 while 1: i = i + 1 if i > 100: break ... root = Tk() menu = Menu(root) root.config(menu=menu) filemenu = Menu(menu) menu.add_casc

Re: test for absence of infinite loop

2018-07-17 Thread dieter
Robin Becker writes: > A user reported an infinite loop in reportlab. I determined a possible > cause and fix and would like to test for absence of the loop. Is there > any way to check for presence/absence of an infinite loop in python? I > imagine we could do something like call

Re: test for absence of infinite loop

2018-07-17 Thread Cameron Simpson
On 17Jul2018 12:39, Robin Becker wrote: On 17/07/2018 12:16, Cameron Simpson wrote: On 17Jul2018 10:10, Robin Becker wrote: A user reported an infinite loop in reportlab. I determined a possible cause and fix and would like to test for absence of the loop. Is there any way to check for

Re: test for absence of infinite loop

2018-07-17 Thread Terry Reedy
) # Former infinite loop I assume that your test runner has some time limit at some level of granularity. You may be able to add a timeout for a particular test. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: test for absence of infinite loop

2018-07-17 Thread Alister via Python-list
On Tue, 17 Jul 2018 10:10:49 +0100, Robin Becker wrote: > A user reported an infinite loop in reportlab. I determined a possible > cause and fix and would like to test for absence of the loop. Is there > any way to check for presence/absence of an infinite loop in python? I > imagine

Re: test for absence of infinite loop

2018-07-17 Thread Steven D'Aprano
On Tue, 17 Jul 2018 10:10:49 +0100, Robin Becker wrote: > A user reported an infinite loop in reportlab. I determined a possible > cause and fix and would like to test for absence of the loop. Is there > any way to check for presence/absence of an infinite loop in python? I > imagine

Re: test for absence of infinite loop

2018-07-17 Thread Robin Becker
On 17/07/2018 12:16, Cameron Simpson wrote: On 17Jul2018 10:10, Robin Becker wrote: A user reported an infinite loop in reportlab. I determined a possible cause and fix and would like to test for absence of the loop. Is there any way to check for presence/absence of an infinite loop in python

Re: test for absence of infinite loop

2018-07-17 Thread Cameron Simpson
On 17Jul2018 10:10, Robin Becker wrote: A user reported an infinite loop in reportlab. I determined a possible cause and fix and would like to test for absence of the loop. Is there any way to check for presence/absence of an infinite loop in python? I imagine we could do something like call

Re: test for absence of infinite loop

2018-07-17 Thread Robin Becker
On 17/07/2018 10:32, Chris Angelico wrote: .. All you gotta do is solve the halting problem... https://en.wikipedia.org/wiki/Halting_problem ChrisA ah so it's easy :) -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: test for absence of infinite loop

2018-07-17 Thread Chris Angelico
On Tue, Jul 17, 2018 at 7:10 PM, Robin Becker wrote: > A user reported an infinite loop in reportlab. I determined a possible cause > and fix and would like to test for absence of the loop. Is there any way to > check for presence/absence of an infinite loop in python? I imagine we c

test for absence of infinite loop

2018-07-17 Thread Robin Becker
A user reported an infinite loop in reportlab. I determined a possible cause and fix and would like to test for absence of the loop. Is there any way to check for presence/absence of an infinite loop in python? I imagine we could do something like call an external process and see if it takes too

Re: Tkinter GUI Question-Infinite Loop

2013-03-08 Thread MRAB
s the program but the menu of the program i'm calling goes into an infinite loop..the offending code seems to be in the button1Click module. Any help is greatly appreciated. You say "the menu *of the program i'm calling* goes into an infinite loop" (my emphasis), so per

Tkinter GUI Question-Infinite Loop

2013-03-08 Thread prquinn
m i'm calling goes into an infinite loop..the offending code seems to be in the button1Click module. Any help is greatly appreciated. Thanks from Tkinter import * import os, sys from win32com.client import Dispatch xlApp=Dispatch('Excel.Application') _PSSBINPATH=r"C:\Progra

Re: Why does this launch an infinite loop of new processes?

2011-12-22 Thread Robert Kern
On 12/22/11 11:24 AM, Robert Kern wrote: Just as a further note on these lines, when older versions of setuptools and distribute install scripts, they generate stub scripts that do not use a __main__ guard, so installing a multiprocessing-using application with setuptools can cause this problem.

Re: Why does this launch an infinite loop of new processes?

2011-12-22 Thread Robert Kern
ain module such that it can properly locate the rest of the code to start. If you do not guard the spawning code with a __main__ test, then this import will cause an infinite loop. Just as a further note on these lines, when older versions of setuptools and distribute install scripts, they gen

Re: Why does this launch an infinite loop of new processes?

2011-12-22 Thread Hans Mulder
On 21/12/11 21:11:03, Andrew Berg wrote: On 12/21/2011 1:29 PM, Ethan Furman wrote: Anything that runs at import time should be protected by the `if __name__ == '__main__'` idiom as the children will import the __main__ module. So the child imports the parent and runs the spawn code again? That

Re: Why does this launch an infinite loop of new processes?

2011-12-21 Thread Andrew Berg
On 12/21/2011 1:29 PM, Ethan Furman wrote: > Anything that runs at import time should be protected by the `if > __name__ == '__main__'` idiom as the children will import the __main__ > module. So the child imports the parent and runs the spawn code again? That makes sense. -- CPython 3.2.2 | Wi

Re: Why does this launch an infinite loop of new processes?

2011-12-21 Thread Ethan Furman
Andrew Berg wrote: I am trying to understand the multiprocessing module, and I tried some simple code: import multiprocessing def f(): print('bla bla') p = multiprocessing.Process(target=f) p.start() p.join() And the result is a new process that spawns a new process that spawns a new pr

Re: Why does this launch an infinite loop of new processes?

2011-12-21 Thread Joshua Landau
On 21 December 2011 18:59, Andrew Berg wrote: > I am trying to understand the multiprocessing module, and I tried some > simple code: > > import multiprocessing > def f(): >print('bla bla') > p = multiprocessing.Process(target=f) > p.start() > p.join() > > And the result is a new process

Re: Why does this launch an infinite loop of new processes?

2011-12-21 Thread Andrew Berg
On 12/21/2011 1:07 PM, Joshua Landau wrote: > Eh? It works for me. Python 3.2 + 2.7 > Is this the full code? That is the full code. -- CPython 3.2.2 | Windows NT 6.1.7601.17640 | Thunderbird 7.0 -- http://mail.python.org/mailman/listinfo/python-list

Why does this launch an infinite loop of new processes?

2011-12-21 Thread Andrew Berg
I am trying to understand the multiprocessing module, and I tried some simple code: import multiprocessing def f(): print('bla bla') p = multiprocessing.Process(target=f) p.start() p.join() And the result is a new process that spawns a new process that spawns a new process ad infinitum un

Re: scheduler or infinite loop

2010-09-29 Thread John Nagle
On 9/29/2010 4:59 AM, harryos wrote: hi I am trying to write a program to read data from a site url. The program must read the data from site every 5 minutes. def get_data_from_site(pageurlstr): h=urllib.urlopen(pageurlstr) data=h.read() process_data(data) A key point here is

Re: scheduler or infinite loop

2010-09-29 Thread Frank Millman
harryos wrote Here is a technique that allows the loop to run in the background, in its own thread, leaving the main program to do other processing - import threading class DataGetter(threading.Thread): thanks Frank A pleasure. I left out a line that will usually be desirable. At the e

Re: scheduler or infinite loop

2010-09-29 Thread harryos
thanks Frank > > Here is a technique that allows the loop to run in the background, in its > own thread, leaving the main program to do other processing - > > import threading > > class DataGetter(threading.Thread): > -- http://mail.python.org/mailman/listinfo/python-list

Re: scheduler or infinite loop

2010-09-29 Thread Frank Millman
,but then it doesn't look right adding so many scheduler.enter() statements.The program is supposed to execute the above function every 5 minutes until the application is shut down by the user. I created an infinite loop while True: print time.asctime() get_data_from_site(

Re: scheduler or infinite loop

2010-09-29 Thread Nitin Pawar
d to execute the above function every > 5 minutes until the application is shut down by the user. > > I created an infinite loop > while True: >print time.asctime() >get_data_from_site('http://somesite.com/') >time.sleep(300) > > Is there a b

scheduler or infinite loop

2010-09-29 Thread harryos
doesn't look right adding so many scheduler.enter() statements.The program is supposed to execute the above function every 5 minutes until the application is shut down by the user. I created an infinite loop while True: print time.asctime() get_data_from_site('http://so

infinite loop when starting pdb

2008-02-12 Thread AndrewStone
I am starting pdb.pm() in an embedded, multithreaded python PyCrust shell (wx toolkit) -- but other than that it's COMPLETELY vanilla :-)) and pdb is getting stuck in an infinite loop, sucking down all CPU. I never get the pdb prompt. Anyone have any experience with this? I'm pre

Re: infinite loop executed in emacs

2006-06-10 Thread BartlebyScrivener
Try Ctrl + Break http://tinyurl.com/qc8np -- http://mail.python.org/mailman/listinfo/python-list

infinite loop executed in emacs

2006-06-10 Thread yaru22
Hi. I'm using python-mode in emacs. I happened to execute the code that contains an infinite loop. The system is hung and it doesn't stop at all. lol How do I manually stop it in emacs? For Eclipse, in java programming, if i happen to fall into an infinite loop, i could juse press

Re: keyboard command to break out of infinite loop?

2006-04-16 Thread BartlebyScrivener
loop should run, and then put an outer limit on it, so that it will run normally as long as it doesn't exceed x, after which it breaks and says, "Hey, Dummy, you were headed into an infinite loop." Could be a good exercise. Thank you again. rick -- http://mail.python.org/mailman/listinfo/python-list

Re: keyboard command to break out of infinite loop?

2006-04-16 Thread Scott David Daniels
zweistein wrote: > Try CTRL + C. If it doesn't work, CTRL + Pause/Break should also work > (if you're running it from the CLI). > > HTH > Note: this will raise a KeyboardInterrupt exception, which you might inadvertently be catching. If you have been lazy and written: try: ex

Re: keyboard command to break out of infinite loop?

2006-04-16 Thread BartlebyScrivener
Thank you, both. I'll put in on a sticky! rick -- http://mail.python.org/mailman/listinfo/python-list

Re: keyboard command to break out of infinite loop?

2006-04-16 Thread kodi
BartlebyScrivener wrote: > Running Python on Win XP. > > When running commands with the interpreter, if you get stuck in a while > loop, is there a keyboard command to break out of it? > > Or is the only way out a triple-finger salute and End Task? > > rd ctrl+c or ctrl+c+enter -- http://ma

Re: keyboard command to break out of infinite loop?

2006-04-16 Thread zweistein
Try CTRL + C. If it doesn't work, CTRL + Pause/Break should also work (if you're running it from the CLI). HTH -- http://mail.python.org/mailman/listinfo/python-list

keyboard command to break out of infinite loop?

2006-04-16 Thread BartlebyScrivener
Running Python on Win XP. When running commands with the interpreter, if you get stuck in a while loop, is there a keyboard command to break out of it? Or is the only way out a triple-finger salute and End Task? rd -- http://mail.python.org/mailman/listinfo/python-list

Re: infinite loop

2005-09-07 Thread Carl Friedrich Bolz
Hi! LOPEZ GARCIA DE LOMANA, ADRIAN wrote: > Hi all, > > I have a question with some code I'm writting: > > > def main(): > > if option == 1: > > function_a() > > elif option == 2: > > function_b() > > else: > > raise 'option has to be either 1 or 2' >

Re: infinite loop

2005-09-06 Thread Mike Meyer
else: > raise 'option has to be either 1 or 2' > if iteration == True: > main() [...] > I want an infinite loop, but after some iterations (996) it breaks: Since no one else mentioend it: this is only iteration in languages which mandate tail recursion elimin

Re: infinite loop

2005-09-06 Thread James
; > print 'hello from function a' > > > > return None > > > > def function_b(): > > > > print 'hello from function b' > > > > return None > > > > iteration = True > > > > option = 1 > > &

Re: infinite loop

2005-09-06 Thread Scott David Daniels
on has to be either 1 or 2' > if iteration == True: > main() > ... I want an infinite loop, but after some iterations (996) it breaks: > ... RuntimeError: maximum recursion depth exceeded > > > I don't understand it. Why am I not allowed to iterate infinite

Re: infinite loop

2005-09-06 Thread Devan L
; raise 'option has to be either 1 or 2' > > if iteration == True: > > main() > > def function_a(): > > print 'hello from function a' > > return None > > def function_b(): > > print 'hello from function

infinite loop

2005-09-06 Thread LOPEZ GARCIA DE LOMANA, ADRIAN
print 'hello from function a' return None def function_b(): print 'hello from function b' return None iteration = True option = 1 main() I want an infinite loop, but after some iterations (996) it breaks: [EMAIL PROTECTED] tmp]$ python test.py hello fr