-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?

Catalin
  • 248
  • 1
  • 2
  • 12
  • 1
    do you want to run python script from command prompt without using python as prefix? any specific reason? – Harsha Biyani May 27 '16 at 06:39
  • Yes, I do... I wanna make a CLI tool, I don't want to use the `python` prefix every time I run it. – Catalin May 27 '16 at 06: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. –  May 27 '16 at 06: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! – Catalin May 27 '16 at 06:47

1 Answers1

-1

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

Catalin
  • 248
  • 1
  • 2
  • 12