By default IDLE (the standard Python IDE) does not show line numbers 😦
You can install the extension IdleX to do this. This is only one of IdleX’s features. See http://idlex.sourceforge.net/features.html for an overview of all features.
You can download IdleX here. After decompressing the ZIP file you only need to run idlex.py to use this extension (and show/hide line numbers).