---
title: "Discussion on \"Using if __name__ == '__main__'\" | Hashnode"
description: "Discussion on \"Using if __name__ == '__main__'\". What is the use of the famous __name__ == '__main__' snippet in python? Find out..."
url: "https://hashnode.com/posts/if-name-main/63162efe360c57fcaa77be77"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Using if \_\_name\_\_ == '\_\_main\_\_'](https://blog.siddhesh.cc/if-name-main?utm_source=hashnode&utm_medium=feed)

What is the use of the famous \_\_name\_\_ == '\_\_main\_\_' snippet in python? Find out...

Sep 5, 2022 · 2 min read · blog.siddhesh.cc  
Updated Apr 22, 2024  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#python3](https://hashnode.com/tag/python3)
-   [#best-practices](https://hashnode.com/tag/best-practices)

## Written by

[Siddhesh Agarwal](https://hashnode.com/@SiddheshAgarwal)

@SiddheshAgarwal · Bengaluru, India

  
[View profile](https://hashnode.com/@SiddheshAgarwal)

Ad astra...

I am a Software Developer. I am fluent in Python JS/TS, PHP and Golang

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
