Simple Loop fails in REPL

May 13, 2012 at 7:25 PM

 

import sys

def main():
    for id in range(1,10):
        print str(id)

if __name__ == "__main__":
    sys.exit(main())

 

 

I am trying to execute this simple loop in the REPL window (ALT-SHIFT-F5) and this is all I get ...

 

Resetting execution engine
Running D:\code\TestPython.py
1The Python REPL process has exited

What am I missing?

 

Coordinator
May 14, 2012 at 11:19 PM

This looks like a 1.5 Alpha bug (maybe earlier). I can reproduce with CPython and IronPython with any code. I'll copy it to our issue tracker, since there doesn't seem to be anything on there.

Ctrl+A, Ctrl+E, Ctrl+E works fine (select all, send to interactive), though it may be less than ideal for large files.

I also noticed that IronPython doesn't think it's running in __main__.

Coordinator
May 14, 2012 at 11:20 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.