Line numbers disabled

Hi folks! even though not naive in programming I´m a python begginer and my OS is Windows 10. I´ve installed python 3.2.10 yesterday but the idle does not show line numbers. In the options menu the line numbers item is disabled (color =light gray) and in the configuring Idle option the “General” item (that permit activate line numbers) is missing. Why? It seems so simple but I´ve been trying hard to solve it and failed.
Thanks!

I don’t have Windows to try it, but in Linux, the Line Numbers option only works in the editor window, not the interpreter window.

In the interpreter, you have a >>> prompt, and code you type is immediately executed. It doesn’t really make sense to number the lines, although you can change the prompt to show a running index. (See below.)

In the file editor, you can enable Line Numbers.

To use a running index for the interpreter prompt, you can do this:


import sys



def mydisplayhook(value):

    sys.ps1.counter += 1

    return sys.__displayhook__(value)



class Prompt:

    def __init__(self):

        self.counter = 1

    def __str__(self):

        return '[In %d] ' % self.counter



sys.displayhook, sys.ps1 = mydisplayhook, Prompt()  # Set both together in one line.



although it doesn’t work in IDLE. (I think IDLE hard codes the prompts?)

Thank you for the answer. I´m not using the python prompt.I am using the python idle.In my windows editor mode the line numbers option is not enabled and I can not mark it. Showing line numbers help to debug code.