# PY file not opening

**URL:** <https://discuss.python.org/t/py-file-not-opening/18861>\
**Category:** Python Help\
**Tags:** help\
**Created:** [September 7, 2022, 11:19pm UTC](https://discuss.python.org/t/py-file-not-opening/18861 "2022-09-07T23:19:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hunter11111](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@hunter11111](https://discuss.python.org/u/hunter11111)\
**Post date:** [September 7, 2022, 11:19pm UTC](https://discuss.python.org/t/py-file-not-opening/18861/1 "2022-09-07T23:19:41Z")

</div>

i have a PY file that will just open and close. I can’t figure it out. please help.

---

<div class="post-metadata">

**Author:** ![MRAB](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@MRAB](https://discuss.python.org/u/MRAB)\
**Post date:** [September 7, 2022, 11:59pm UTC](https://discuss.python.org/t/py-file-not-opening/18861/2 "2022-09-07T23:59:19Z")

</div>

When you run the program, it opens a window, and when the program finishes, it closes the window. That’s normal.

---

<div class="post-metadata">

**Author:** ![barry-scott](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@barry-scott](https://discuss.python.org/u/barry-scott)\
**Post date:** [September 8, 2022, 6:04am UTC](https://discuss.python.org/t/py-file-not-opening/18861/3 "2022-09-08T06:04:48Z")

</div>

Start cmd,exe and in cmd run your .py using the py.exe program like this:

py myprog.py
