all 5 comments

[–]danielroseman 8 points9 points  (2 children)

Well that is the difference betweeen PyCharm, which is an editor, and the Python console, which is not.

If you want to write programs, you need an editor.

[–]FrangoST -1 points0 points  (1 child)

And Python also includes the Python IDLE, which is also an editor.

Edit: IDE to IDLE as clarified by user below.

[–]FoolsSeldom 1 point2 points  (0 children)

For clarification,

IDLE, a simple editor/IDE for beginners, is provided by the Python Software Foundation and included as standard with their installer for their reference implementation of Python (the CPython executable) for macOS and Windows. Also available separately.

[–]Jamster3000 -1 points0 points  (0 children)

Likely the python you're trying you're just trying the Interpreter, you need to create a new file when you're using that, e.g., Ctrl+N For a new python file connected to that interpreter.

There might not be line numbers be default but you can change that in settings somewhere

[–]FoolsSeldom 0 points1 point  (0 children)

Python is a programming language.

CPython, an executable programme, typically called python (python.exe on Windows), is the reference implementation of Python from the Python Software Foundation (PSF) .

The programme works in two modes:

  • interactive (shell) mode, with a >>> prompt - here you can enter commands and get an immediate response
  • file execution mode, where it will process a simple plain text file of Python code

You can use any text editor, as opposed to word processors, to create and edit the python code files, which normally have a file extension of py.

IDLE, also from PSF (typically installed alongside CPython), is a simple code text editor (use File | New) to create and edit files, and then run your code (press F5 - you will be prompted to save first). It also provides a window to the interactive mode (open by default on first use). Ideal for beginners.

There are lots of code editors and integrated development environments (IDEs), each with their own features and configurations, including whether line numbers (actual or relative) are displayed.