Skip to content

Instantly share code, notes, and snippets.

@maciakl
Created January 10, 2022 21:27
Show Gist options
  • Select an option

  • Save maciakl/cf7b3c5d237c856cef61472a9358526e to your computer and use it in GitHub Desktop.

Select an option

Save maciakl/cf7b3c5d237c856cef61472a9358526e to your computer and use it in GitHub Desktop.
This fixes the issue on Windows where running Python script directly by invoking its name (eg. script.py) on the command line, launches a new console window, instead of showitg the output in the same console.
rem Run CMD.EXE as Admin, then
assoc .py=Python.File
rem Assuming you installed Python via the Microsoft use below
rem If yuou installed Python via an installer, substitute the absolute path to the python executable
ftype Python.File=%LOCALAPPDATA%\Microsoft\WindowsApps\python.exe "%1" %*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment