Python 中的 PYTHONUNBUFFERED 环境变量是干嘛的?

上面是一个常见的 dockerfile ,其中有一行 ENV PYTHONUNBUFFERED 1,我都是无脑加上的,然而不晓得不加会有什么结果!

FROM python:3.9-busterENV PYTHONUNBUFFERED 1RUN mkdir /codeWORKDIR /codeCOPY requirements.txt /code/RUN (/usr/local/bin/python -m pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple) && (pip install -i https://mirrors.aliyun.com/pypi/simple -r requirements.txt)COPY . /code/

看了和这个文章:Python环境变量PYTHONUNBUFFERED

对于3.7以上版本: 规范输入stdout和规范谬误stderr全副采纳unbuffered
Changed in version 3.7: The text layer of the stdout and stderr streams now is unbuffered.

只有是 version > 3.7 就不须要加了 PYTHONUNBUFFERED