python,用__import__()怎么写语句“from sys import stdin”?

来源:学生学帮网 编辑:学帮网 时间:2024/06/11 03:26:10

python,用__import__()怎么写语句“from sys import stdin”?

他们都错了.
from sys import stdin之后你的这个scope的dict里是增加了stdin啊.
所以应该是:
temp=__import__('sys')
stdin=temp.stdin
del temp