Python Sandbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • elcron
    New Member
    • Sep 2007
    • 43

    #1

    Python Sandbox

    Hi,
    I'm using python 2.5 on Vista and writing a Genetic Program in Python. I was wondering is there a way to run a script from within another one but in sandbox environment? If there is can it automatically kill the script if it runs too long? I know you can use the exec() function but it can override variables in the current script and could get stuck in an infinite loop. I'm wondering because sometimes the program being tested gets in an infinite loop like below and I need the program executing it to continue running.
    [code=python]
    i = 10
    while i <= 10:
    print i
    i -= 1
    [/code]
  • fredniggle
    New Member
    • Jan 2008
    • 12

    #2
    Opps

    I was about to adive you about fuinctions, then I realised your skill level far exceeds mine.
    Last edited by fredniggle; Jan 5 '08, 08:12 PM. Reason: Didnt read original post properly

    Comment

    Working...