PyCharm enables you to compare two arbitrary files in a project (including image files), or compare a file in the editor with the Clipboard contents, using the Differences viewer.

  1. Keeping the Ctrl key pressed, click two files in the Project tool window.
  2. On the context menu of the selection, choose Compare Two Files. The Differences Viewer for Files opens, with the differences being color-highlighted.

    It is enough to select a single file in the Project tool window. In this case the context menu command is Compare File with Editor, and the Differences Viewer shows the contents of the selected file on the left pane, and the contents of the active editor tab on the right pane.

  3. View the differences and apply them, if necessary, using the buttons icon_InsertReplace and icon_InsertReplace2.

    compareFiles

See Also

Procedures:

Reference:

Web Resources: