You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IDLE: make .py default added extension on save #54573
Whenever I run a program in Python 3.1.2 (windows), the color coding disappears. print() is no longer purple, def is no longer orange, etc. It all turns black, and there doesn't seem to be a way to repair this. I've installed and uninstalled Python 3.1.2 several times and it's done nothing. Loading previous programs also causes this. Only if I am making a new program is the coding separated by color. Can anyone help?
This is an editor rather than Python problem. Are you using the IDLE editor or something else. Which version of Windows?
Orange and purple are IDLE's default for keywords and built-in names. But running 3.1.2 under XP, I have no problem as you describe, either after running or loading.
If it is an editor window that you launch from IDLE, with a red script Tk in the upper left corner, with 'About IDLE' on the help menu, then it is an IDLE editor window and part of IDLE -- and appropriate for bug reports here ;-).
This could be something specific to Vista; I do not know how well interactive things are tested there.
Typo commented on Nov 8, 2010
Typomannequin
MannequinAuthor
More actions
Ah I see. I didn't know that the editor window was part of Idle. Sorry for the confusion.
I take that as a yes, IDLE edit window. 2.5 is beyond fixing at this point, but that is useful data. I will look out for this problem when I load Python on Win7.
Hey, I found out what the problem was. I wasn't saving the files as a .py file. As soon as I did that the color came back. Sorry to have wasted your time >.<
Thank you for reporting back. This could be closed as invalid, but since I think this is something I should have known or guessed, I will leave it open for now as a reminder to look at the docs sometime and see if anything should be added somewhere.
Excuse me for budging in, I was having the same problem (both python 3.2 and 2.7, on both win XP and 7) without knowing the file extention is the cause.
Why doesn't IDLE editor save files with the .py extention unless specificly ordered to? The Save as dialoge window has a "type" drop-down menue. Maybe I'm missing some of the logic behind it?
I am guessing that because the extension could be either .py or .pyw, the initial save does not add either but forces the user to type one or the other. I find this annoying too, so I am thinking about separating the choices and see if .py, .pyw, and maybe .txt can be automatically added if not written, while avoiding '.py.py', etc. Hence the change of issue title and type. (Note to self: make sure this is not a duplicate.)
Activity
Typo commentedon Nov 8, 2010
Whenever I run a program in Python 3.1.2 (windows), the color coding disappears. print() is no longer purple, def is no longer orange, etc. It all turns black, and there doesn't seem to be a way to repair this. I've installed and uninstalled Python 3.1.2 several times and it's done nothing. Loading previous programs also causes this. Only if I am making a new program is the coding separated by color. Can anyone help?
terryjreedy commentedon Nov 8, 2010
This is an editor rather than Python problem. Are you using the IDLE editor or something else. Which version of Windows?
Orange and purple are IDLE's default for keywords and built-in names. But running 3.1.2 under XP, I have no problem as you describe, either after running or loading.
Typo commentedon Nov 8, 2010
I am using Windows Vista. The problem is not within Idle but within the screen where you create and save coding to use in Idle.
terryjreedy commentedon Nov 8, 2010
If it is an editor window that you launch from IDLE, with a red script Tk in the upper left corner, with 'About IDLE' on the help menu, then it is an IDLE editor window and part of IDLE -- and appropriate for bug reports here ;-).
This could be something specific to Vista; I do not know how well interactive things are tested there.
Typo commentedon Nov 8, 2010
Ah I see. I didn't know that the editor window was part of Idle. Sorry for the confusion.
I am also receiving this problem in Python 2.5.1.
terryjreedy commentedon Nov 8, 2010
I take that as a yes, IDLE edit window. 2.5 is beyond fixing at this point, but that is useful data. I will look out for this problem when I load Python on Win7.
Typo commentedon Nov 12, 2010
Hey, I found out what the problem was. I wasn't saving the files as a .py file. As soon as I did that the color came back. Sorry to have wasted your time >.<
terryjreedy commentedon Nov 12, 2010
Thank you for reporting back. This could be closed as invalid, but since I think this is something I should have known or guessed, I will leave it open for now as a reminder to look at the docs sometime and see if anything should be added somewhere.
Ariel commentedon Oct 24, 2011
Excuse me for budging in, I was having the same problem (both python 3.2 and 2.7, on both win XP and 7) without knowing the file extention is the cause.
Why doesn't IDLE editor save files with the .py extention unless specificly ordered to? The Save as dialoge window has a "type" drop-down menue. Maybe I'm missing some of the logic behind it?
terryjreedy commentedon Oct 24, 2011
I am guessing that because the extension could be either .py or .pyw, the initial save does not add either but forces the user to type one or the other. I find this annoying too, so I am thinking about separating the choices and see if .py, .pyw, and maybe .txt can be automatically added if not written, while avoiding '.py.py', etc. Hence the change of issue title and type. (Note to self: make sure this is not a duplicate.)
[-]Color coding fails after running program.[/-][+]IDLE: make .py default added extension on save[/+]serwy commentedon Dec 9, 2011
This is a duplicate of bpo-4832.