So add these lines at the beginning of aliases.sh alias python2='winpty C/Networking/"Network Automation"/"Python 2.7"/python.exe'Īlias python='winpty C/Networking/"Network Automation"/"Python 3.7"/python.exe'ģ) Add or Modify other aliases (if you want) Winpty is the magic command that will call the executable. Git Bash uses linux file structure so you need to change the "\" for "/"Īnd if you have a path like my example Network Automation you put it with " " So you must create 2 aliases, one for Python 2 ( I named python2) and the other for Python 3 ( I named just python) In my case the python.exe are installed in: C:\Networking\Network Automation\Python 2.7\python.exeĬ:\Networking\Network Automation\Python 3.7\python.exe It is located in:Ĭ:\path where you installed Git\etc\profile.d\aliases.sh 1) Open (with a text editor like Atom or other) the aliases.shįor ex: in my case the file is in C:\Software\Develop\Git\etc\profile.d\aliases.sh 2) Add your alias for Python This is (for me) the best solution to run both Python (Python 2.7 and Python 3.x) directly from Git Bash on Win 10 => adding aliases into the aliases file that Git Bash uses for. Git Bash Workaround- Launch Python 2
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |