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

来源:学生作业学帮网 编辑:学帮网 时间:2024/05/16 06:18:52

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

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