Tuesday, December 20, 2016

running both 2.7 and 3.5 on windows

I finished some online courses for python 2.7 and grew quite comfortable with it. I save my scripts with a ".py" extension and call it from the dos prompt under the script's directory.

When I started the DataScience course, I had to move to python 3.5 but did not want to let 2.7 go. Most blogs advised to move and and just let go. But I didn't T_T.

So I kept both versions and installed them on the same machine. Both under c:\


rawr!


Scripts written on version 2.7 would run just fine when called from its current directory. For vesion 3.5, I add the line "#! C:\Python35\python.exe" at the very top so it can call python 3.5.

This works for me. Hope it does for you too!  

No comments:

Post a Comment