---
title: "Discussion on \"name_ variable in Python\" | Hashnode"
description: "Discussion on \"name_ variable in Python\". In this article we will explore the __name__ variable, its purpose and how we can use it to tell where a module or script is being executed from. \nYou may have come along the __name__ variable when going through some code, scripts or modules. The fol..."
url: "https://hashnode.com/posts/name-variable-in-python/66129b362254e74c4be5a340"
---

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

Discussion

# [name\_ variable in Python](https://blog.pynerds.com/name-variable-in-python?utm_source=hashnode&utm_medium=feed)

In this article we will explore the \_\_name\_\_ variable, its purpose and how we can use it to tell where a module or script is being executed from. You may have come along the \_\_name\_\_ variable when going through some code, scripts or modules. The fol...

Apr 7, 2024 · 4 min read · blog.pynerds.com  
Read the article

-   [#python3](https://hashnode.com/tag/python3)
-   [#python](https://hashnode.com/tag/python)
-   [#python-modules-and-packages](https://hashnode.com/tag/python-modules-and-packages)
-   [#python-beginner](https://hashnode.com/tag/python-beginner)
-   [#python-projects](https://hashnode.com/tag/python-projects)

## Written by

[John Main](https://hashnode.com/@pynerds)

@pynerds

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

Writer at www.pynerds.com

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
