python調用主函數,具體方法如下:
import datetimeprint('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()
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()
億速云公眾號
手機網站二維碼
Copyright ? Yisu Cloud Ltd. All Rights Reserved. 2018 版權所有
廣州億速云計算有限公司粵ICP備17096448號-1 粵公網安備 44010402001142號增值電信業務經營許可證編號:B1-20181529