-4

I want to run my python script without the python keyword at the beginning.

Example : I don't want python script.py.

I want script.py

The problem is that when I run it how I want the script opens in a text editor, and it doesn't run in the console...

Why?

4
  • 1
    do you want to run python script from command prompt without using python as prefix? any specific reason? Commented May 27, 2016 at 6:39
  • Yes, I do... I wanna make a CLI tool, I don't want to use the python prefix every time I run it. Commented May 27, 2016 at 6:41
  • Type ftype /? and assoc /?. If you also want to dump the .py part - see set pathext. If it's just one file see doskey /?. Batch files are also used for this. The dup is similar problem and cause but is bash specific. Commented May 27, 2016 at 6:46
  • It's not a duplicate... I've ran it like so on another computer, without the python prefix, and it works.. Now - on windows 10 it opens the file in a text-editor instead running it! Commented May 27, 2016 at 6:47

1 Answer 1

-1

I just had to set the default opening of the file with python.exe, By default it was with VS Code.

Sign up to request clarification or add additional context in comments.

2 Comments

That's what the commands I told you do. But in a command prompt.
You should've been more explanatory!!!!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.