Python & OpenAI beginner journey 2 | def main()

For the first few python documents I wrote, I just started writing my code on an empty page, before I learned about main().

For some time I always asked ChatGPT to generate the main function for me since I could never remember how exactly it has to look.

Now I just saved it as a code block in Notion and quickly copy it in my new python program from there.

I’m not sure yet what exactly the best way is to store and reuse code blocks that appear frequently. Does anyone have recommendations?

def main():
    ...

if __name__ == '__main__':
    main()

Enter fullscreen mode Exit fullscreen mode

原文链接:Python & OpenAI beginner journey 2 | def main()

© 版权声明
THE END
喜欢就支持一下吧
点赞14 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容