python中关于__name__的做用

测试程序1,路径D:\Tensorflow\test\file\test.pypython 当咱们直接运行上面程序时,程序代码以下函数 #test print ('test name:',__name__) 输出结果:能够看出此时__name__的值就等于__main__,表示当前程序为主程序直接运行 测试程序2,当咱们在上面程序test上级目录D:\Tensorflow\test下建立程序tes
相关文章
相关标签/搜索