From 3e4db94dbf23803c004e012b0d222b798625053d Mon Sep 17 00:00:00 2001 From: Ed Hazledine Date: Sun, 11 Apr 2021 11:46:53 +0100 Subject: [PATCH 1/2] Add if name == main snippet --- snippets/python_snippets.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/snippets/python_snippets.json b/snippets/python_snippets.json index 65c520b..c34d7e0 100644 --- a/snippets/python_snippets.json +++ b/snippets/python_snippets.json @@ -3468,6 +3468,14 @@ ], "description": "__iter__ method" }, + "if __name__": { + "prefix": "if __name__=>", + "body": [ + "if __name__ == \"__main__\":", + " " + ], + "description": "if name equals main" + }, "__next__": { "prefix": "__next__=>", "body": [ From b853a86dfb6a764c8acc8740f6af650464d1cc45 Mon Sep 17 00:00:00 2001 From: Ed <31481469+edhaz@users.noreply.github.com> Date: Sun, 11 Apr 2021 12:49:36 +0100 Subject: [PATCH 2/2] Update snippets/python_snippets.json --- snippets/python_snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/python_snippets.json b/snippets/python_snippets.json index c34d7e0..eee28b0 100644 --- a/snippets/python_snippets.json +++ b/snippets/python_snippets.json @@ -3472,7 +3472,7 @@ "prefix": "if __name__=>", "body": [ "if __name__ == \"__main__\":", - " " + "\t" ], "description": "if name equals main" },