T
Tim
Hi,
I learned that a Python script is written in this way:
def main():
...
if __name__ == "__main__":
main()
Today, when I read a script, I found it has a different way:
def main():
...
main()
It can run as well. Can someone explain why and the rules that Python scripts get run?
Thanks and regards,
Tim
I learned that a Python script is written in this way:
def main():
...
if __name__ == "__main__":
main()
Today, when I read a script, I found it has a different way:
def main():
...
main()
It can run as well. Can someone explain why and the rules that Python scripts get run?
Thanks and regards,
Tim