Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error on bat file
#8
py.exe get installed in Windows folder when install Python37.
Can be used to accessing previous version or current,can also install with pip to all version installed.
Example:
# Python version set in Windows Path
C:\>python -V
Python 3.7.0

# Can also access with py
C:\>py -3.7 -V
Python 3.7.0

# Older version i have
C:\>py -2.7 -V
Python 2.7.9

C:\>py -3.4 -V
Python 3.4.2

C:\>py -3.5 -V
Python 3.5.2

C:\>py -3.6 -V
Python 3.6.4
Use py to install with pip to eg 2.7.
λ py -2.7 -m pip install logzero                                                                               
Requirement already satisfied: logzero in c:\python27\lib\site-packages
Making bat hello.bat.
Use python main version,pause in bat so cmd window doesn't close immediately.
Can also put this last in code input('Press Enter to exit').
@echo off
python C:/foo/hello.py %*
pause
If want to run 2.7 in a bat file,then use py.
@echo off
py -2.7 C:/foo/hello.py %*
pause
Reply


Messages In This Thread
error on bat file - by Sanlus - Aug-27-2018, 11:09 AM
RE: error on bat file - by Larz60+ - Aug-27-2018, 11:21 AM
RE: error on bat file - by Sanlus - Aug-27-2018, 11:37 AM
RE: error on bat file - by Larz60+ - Aug-27-2018, 11:45 AM
RE: error on bat file - by Sanlus - Aug-27-2018, 12:09 PM
RE: error on bat file - by Larz60+ - Aug-27-2018, 12:13 PM
RE: error on bat file - by Sanlus - Aug-27-2018, 12:46 PM
RE: error on bat file - by snippsat - Aug-27-2018, 02:47 PM
RE: error on bat file - by Sanlus - Aug-28-2018, 05:42 AM
RE: error on bat file - by snippsat - Aug-28-2018, 02:10 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020