摘要: python写脚本测试执行为什么要写if __name__ == '__main__' a56爆大奖在线娱乐的博客 在写python脚本的时候,例如,a56爆大奖在线娱乐写一个test1.py def test(n): print(n) if __name__ == '__main__': n = 1 test(1) 接下来打开cmd命令窗口,执行命令 python test.py 结果是把1打印出来 这时候就会有同学有 阅读全文
posted @ 2022-10-07 23:16 咻_python 阅读(208) 评论(0) 推荐(0) 编辑