Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的编辑器中只有以下内容:
def main (): print("hello!"); //Also tried print "hello"
每次我执行 Run->"Run Module" 时,Python shell 都会重新启动并且没有打印任何内容
在 Python 中没有默认的主要行为,所以你通常想要做的是:
def main(): # your code if __name__ == "__main__": # this means that the script was an argument for the interperet main()