python中如何調(diào)用主函數(shù)

九三
2140
2021-02-18 18:30:38
欄目: 編程語言

python中如何調(diào)用主函數(shù)

python調(diào)用主函數(shù),具體方法如下:

import datetime

print('Hello World!')

print('Time is ', datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S %A'))

def main():

print('this message is from main function')

if __name__ == '__main__':

main()

0