Home (All Topics) → Technology → Software → AI-Created Software
The following is AI-generated (aka vibe-coded) software. The software is specific to my needs and my system and may not work for you or your system. Support is limited, but if you report a bug I'll certainly look into it. All code is provided in a zip file for you to review should you choose.
Pick two folders, and the app lists every file in both, with their subfolders, in one table: which files are the same, which differ, which copy is newer, and which are in one folder only. It is a single Python script with a window (Tkinter), and needs nothing beyond the Python standard library.
sudo apt install python3-tk).
python compare-files-in-different-folders.py
On Windows, pythonw.exe runs it without a console window. The window opens where it was last closed, at the same size, and maximized if it was.
Type or paste a folder in Folder A and Folder B (or use Browse…), then click Compare folders (or press F5, or Enter in a field). The status bar shows the progress, and then the result: green when every file could be read, red, starting with ⚠, when some couldn’t.
Each file gets a status:
| Status | Meaning | Shown in |
|---|---|---|
| Identical | In both folders, with the same size and modified date (within the date tolerance). With Verify contents on: the same contents, whatever the dates. | Green |
| Different | The same modified date, but a different size or different contents. | Red |
| Newer in A, Newer in B | The modified dates differ, and that folder’s copy is newer. | Bold black |
| Only in A, Only in B | The file is in one folder only. | Gray |
Files are matched by name, wherever they are in the subfolders. A name found more than once in a folder is paired with every copy in the other folder.
The Content column says whether the contents are the same (Same), differ (Differs, always known when the sizes differ), weren’t checked (Not checked), or couldn’t be read (Read error).
The date and size columns are green when the two copies match and red when they don’t.
Files and folders that can’t be read (permission denied, for example) aren’t left out silently: View errors lists them, with the reason, in a window that opens where it was last closed. Close it with Esc.
All of them are remembered between sessions.
Report.PDF and report.pdf are the same file, as Windows treats them. The row shows both names (Report.PDF ↔︎ report.pdf).;, with the wildcards * and ?. A pattern without a backslash is matched against file and folder names at any depth (Thumbs.db; *.tmp; .git); one with a backslash (or a forward slash) is matched against the path from the chosen folder (build\*). Excluded folders aren’t scanned at all. The status bar says how many files and folders were excluded.
Export to TSV… writes the rows shown, in the table’s order, to a tab-separated file that opens in Excel: UTF-8 with a byte-order mark (so accented names read correctly), Windows line ends, a heading line, and the texts as shown. A tab or line break inside a name becomes a space.
Settings are kept in compare-files-in-different-folders.ini in the working folder: %APPDATA%\compare-files-in- different-folders on Windows (~/.config/compare-files-in-different-folders elsewhere), or the folder given with --working-folder-path.
They are saved when you compare and when you close the window; if they can’t be saved, a message says so, once a session.
Earlier versions kept the settings beside the script, chosen with --settings. The first time this version starts with no settings in its working folder, it reads the old file, so your folders and options carry over; the old file is left as it is, and can be deleted.
python compare-files-in-different-folders.py [--working-folder-path FOLDER] [--selftest TRUE]
Options can come in any order, as --name VALUE or --name=VALUE. --help lists them, with their defaults.
| Option | What it does |
|---|---|
--working-folder-path FOLDER |
The folder for the settings file and temporary files, created if needed. Blank: the default above. A folder that can’t be created is an error. |
--selftest TRUE |
Checks the comparison (statuses, case, contents, dates, exclude patterns, the export) on test files of its own, without opening a window, then says whether Tkinter and Pillow are there. Exits with 0 when every check passes, 1 when one fails. |
--help |
Lists the options and exits. |
A mistake on the command line (an unknown option, an option without its value, a bare file name) prints an error and exits with status 2; without a console it is shown in a message box.
| Keys | What they do |
|---|---|
| F5 | Compare the folders. |
| Enter | In a folder field, the date tolerance or the exclude field: compare the folders. |
| Ctrl+A | In a text field: select all. |
| Esc | In the errors window: close it. |
python compare-files-in-different-folders.py --selftest TRUE
python -m pytest
The tests need pytest; the window tests need a display (on Linux without one, the tests start Xvfb and openbox if they are installed, and skip the window tests if not). tests/test_compare.py checks the comparison, the export, the old settings and the command line without a window; tests/test_app.py drives the real window: comparing, filtering, sorting, column widths, the errors window, exporting, saving and restoring the settings and the window, the colors, display scaling, the fit at the minimum window size, and closing during a comparison.
On 2026-10-07 the 32 tests passed in 11.2 s at 100% display scaling and in 8.9 s at 150% (Xvfb at 144 dpi), on Linux with Python 3.12.
tools/make_icon.py draws the icon (compare-files-in-different-folders.ico, with Pillow).
--working-folder-path.


Leave a Reply