Sam
Sam

Reputation: 31

IOError: [Errno 0] Error when running python code using visual studio code

I'm very new to Visual Studio Code even beginner in python coding. I have tried the following very simple code:

for i in range(1000):
    print i

Each time I run the code I got the following error after printing some of i's:

print i

IOError: [Errno 0] Error

I'm using python 2.7

Your help on this is highly appreciated. Thanks.

Upvotes: 3

Views: 1794

Answers (2)

Alexper
Alexper

Reputation: 353

After researching on the web about it, it appears to be a Windows issue which has been resolved in the Windows 1803 release. See https://github.com/Microsoft/vscode/issues/36630#issuecomment-357084696

Edit:

A workaround is to use external instead of redirected terminal.

Add the line:

"console": "externalTerminal",

to your launch.json.

Upvotes: 1

Boban Ljubicic
Boban Ljubicic

Reputation: 3

It looks like there is a problem with input/output. Try to run it from cmd or bash if you are on Ubuntu.If that doesn't work try from Python IDLE.

Upvotes: 0

Related Questions