[b]"How do I run a Python command in a Python file?"[/b] or [b]"What's the best way to run a Python command in a P

18 Replies, 1493 Views

Yo! Newbie here too, but figured this out recently.

Double-clicking *kinda* works, but the terminal closes too fast. Instead:

1. Open Command Prompt.
2. Drag your .py file into the cmd window—it’ll auto-fill the path.
3. Hit Enter after typing `python` before the file path.

Boom! Output stays visible.

Also, check out "Python for Beginners" on realpython.com—super helpful for stuff like run python command in python file.

Messages In This Thread



Users browsing this thread: 1 Guest(s)