Auto complete if __name__ == "__main__":
已完成
How can I set pycharm up such that when I start typing if __name__... it auto generates the rest of the line?
Secondly, and not related to pycharm, what is this line called? I know the purpose of it, but I dont know how to express it without describing aloud something like this: "the `if name = main` line". haha
请先登录再写评论。
You can use live templates as in this video tutorial. This quick answer is to use command+j (Mac) or ctrl+j (Windows) to bring up the live templates list, then then type "m" to search for the shortcut to __name__=='__main__', then hit enter.