Pergunta

I recently switched python distributions to Anaconda from Continuum Analytics. After installing Python 3.3, I created a build system for use with Sublime (3):

{
    "cmd": ["python.exe", "$file"],
    "path": "D:/Users/bsouthga/AppData/Local/Continuum/Anaconda/envs/py33/",
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.py",
}

It runs scripts fine, except for the fact that output is only printed upon completion of the build. How can I enable normal (live) printing?

Foi útil?

Solução

It's possible that you need to run the script in "unbuffered" mode via the -u flag.

Force the binary layer of the stdout and stderr streams (which is available as their buffer attribute) to be unbuffered. The text I/O layer will still be line-buffered if writing to the console, or block-buffered if redirected to a non-interactive file.

This solution isn't specific to Anaconda, but may still be the issue.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top