Skip to main content
edited tags
Link
Mark Tolonen
  • 180.6k
  • 26
  • 182
  • 278
deleted 6 characters in body
Source Link
Georg Plaz
  • 6k
  • 5
  • 43
  • 66

I installed Python 2.6 and Python 3.1 on Windows 7 and set environment variable: path = d:\python2.6.

When I run python in cmd, it displays the python version 2.6, which is what I want!
But, when I wrote a script in a bat file and ran it, the displayed python version was 3.1.

    import sys
    print (sys.version)

What's going on here?

I installed Python 2.6 and Python 3.1 on Windows 7 and set environment variable: path = d:\python2.6.

When I run python in cmd, it displays the python version 2.6, which is what I want!
But, when I wrote a script in a bat file and ran it, the displayed python version was 3.1.

    import sys
    print (sys.version)

What's going on here?

I installed Python 2.6 and Python 3.1 on Windows 7 and set environment variable: path = d:\python2.6.

When I run python in cmd, it displays the python version 2.6, which is what I want!
But, when I wrote a script in a bat file and ran it, the displayed python version was 3.1.

import sys
print (sys.version)

What's going on here?

"Be more specific over general in writing and text". Literal Text and version complications; Simplify Writing; BAT means Batch-file but not everyone is savvy with scripting terms.
Source Link

How shouldShould I set the defaultSet Default Python version inVersion In Windows?

I installed Python 2.6Python 2.6 and Python 3Python 3.1 on Windows 7 and set environment variable: path = d:\python2.6.

When I run python in cmdcmd, it displays the python version is 2.6, which is rightwhat I want!

But
But, when I wrote a script in a bat file and ran it, the displayed python version was 3.1.

What is wrong here?

The script code in bat file:

    import sys
    print (sys.version)

What's going on here?

How should I set the default Python version in Windows

I installed Python 2.6 and Python 3 on Windows 7 and set environment variable: path = d:\python2.6.

When I run python in cmd, it displays the python version is 2.6, which is right!

But when I wrote a script in a bat file and ran it, the displayed python version was 3.1.

What is wrong here?

The script code in bat file:

import sys
print (sys.version)

How Should I Set Default Python Version In Windows?

I installed Python 2.6 and Python 3.1 on Windows 7 and set environment variable: path = d:\python2.6.

When I run python in cmd, it displays the python version 2.6, which is what I want!
But, when I wrote a script in a bat file and ran it, the displayed python version was 3.1.

    import sys
    print (sys.version)

What's going on here?

The python question is largely related to Windows OS. Added corresponding tag and clarified the question. Also fixed grammar.
Source Link
Loading
added 6 characters in body; edited title
Source Link
ForceBru
  • 45k
  • 10
  • 71
  • 104
Loading
Source Link
rooney
  • 2.5k
  • 4
  • 20
  • 10
Loading