Re: Python Countdown

Discussion in 'Python' started by Simon Brunning, Nov 11, 2005.

  1. On 11/11/05, john boy <> wrote:
    > I have adjusted the program to:
    >
    > import sys.
    > sys. getrecursionlimit()
    > sys.setrecursionlimit(2000)
    > def countdown (n):
    > if n ==0:
    > print "blastoff"
    > else:
    > print n
    > countdown (n-1)
    > countdown (1200)
    >
    > this acutally works now....


    Good!

    > is there any way to permanently set the recursion
    > level or do I have to type a setrecursionlimit everytime the program will
    > likely exceed 1000


    Well, you could always always set it in site.py, I suppose, but in
    general, I prefer iteration over recursion in Python.

    --
    Cheers,
    Simon B,
    ,
    http://www.brunningonline.net/simon/blog/
     
    Simon Brunning, Nov 11, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ryan Stewart

    GUI countdown timer in a JApplet?

    Ryan Stewart, Dec 23, 2003, in forum: Java
    Replies:
    2
    Views:
    872
  2. vasilis

    Countdown

    vasilis, Aug 23, 2004, in forum: Java
    Replies:
    2
    Views:
    697
    Nick Pomfret
    Aug 23, 2004
  3. Replies:
    5
    Views:
    580
    Andrew Thompson
    Nov 30, 2004
  4. JSP countdown timer

    , Nov 1, 2005, in forum: Java
    Replies:
    4
    Views:
    14,778
  5. Simon Brunning

    Re: Python Countdown

    Simon Brunning, Nov 11, 2005, in forum: Python
    Replies:
    0
    Views:
    470
    Simon Brunning
    Nov 11, 2005
Loading...

Share This Page