Confused with two keywords:
This question already has an answer here:
__name__
will give you the name of the current module and module which is used when you say
python prog.py
__name__
in prog.py
would now be __main__
. This has been explained in python docs here
上一篇: 为什么一些python脚本以这种方式声明main()?
下一篇: 与两个关键字混淆: