Photo by Dlanor S on Unsplash

Getting Python Shell To Work on Git Bash — Windows, Mac, Linux.

Do you prefer working with Git Bash for Python and don’t fancy using CMD and Powershell? This short post is for you.

--

Getting Python IDLE to work on Git Bash might be a problem. Typing python into CMD or Powershell will activate the Python shell on Windows, doing the same on Git Bash just doesn’t work. It simply returns you a blank line that does nothing.

To solve this, simply type in winpty python in Git Bash or you can also type python -i Both of these commands will activate the Python shell.

One thing to note is this; If you use winpty python you can exit the IDLE using CTRL + Z or exit() . But with python -i exiting with CTRL + Z will not work. Only using exit() will.

Have a great day!

--

--

Presh Onyee

User Experience Designer sharing random thoughts on creativity and product design.