0

All of the scripts that I save in the C:\Python33 folder are opening with my other installation of Python 2.7.

Is there a quick fix for this?

ndurvasula
  • 185
  • 5
  • 18

2 Answers2

2

Add the line:

#! python3

at the start of your scripts. See the Windows launcher documentation.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
0

if you mean that the script run with python2.7 in command line, then you need to change PATH environment variable. so it include python3.3 folder and not python2.7 folder.

look at: how to change PATH variable

if you speak about double-click openning in windows, then you need to change the default "open-with" program. you can see how to do it here: http://windows.microsoft.com/en-us/windows/change-default-programs

if you speak about IDLE editor, note that you have two IDELS, one for each python version. (you can see which version it is in the start-up text. for example:

Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.

but, If I understand you last comment right, what you looking for is exactly the answer that was answered here: Using "Edit with IDLE" with a Python 2.6.5 script

Community
  • 1
  • 1
Elisha
  • 4,811
  • 4
  • 30
  • 46
  • Well the program runs with python 2.7 when you click F5 or click run in the editor. It works fine in the command line – ndurvasula Feb 09 '14 at 14:17
  • Sorry about that. What I meant was that the open with is set to python 2.7. I am not able to change this even when I go through the dialog. The default compiler remains as python 2.7 even when I try to change it. The solution from that other question helped – ndurvasula Feb 11 '14 at 01:00