How to enter python interactive mode with git bash.
With Windows powershell, simply typing python
will put you in interactive mode, but git bash won't.
winpty
Add winpyty
at the beginning of the command.
└ winpty python
This is all you need
$ winpty python
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
ʻExit ()` when exiting interactive mode └ Bracket required
>>> exit()
With normal python, indentation will result in an error if you can't do it one by one.
python
#ipython installation
pip install ipython
#launch ipython
winpty ipython
#Successful startup
Python 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.8.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]:
Normal python >>>
becomes ʻIn [line number]:`.
ʻExit or ʻexit ()
when exiting interactive mode
└ No need for parentheses
In [1]: exit
Something useful (or essential) for using python.
> Pip details and list of main commands
> Click here for setting method
Once you get used to it, it's easy to set up, and it's a must-have feature if you use gitbush.
Recommended Posts