You can buy 2 cheap usb to 485 plugs from amazon like this, as thats the most common hardware standard to talk over modbus
And wire them together and write a py script that talks to itself or annother script across 2 com ports
Python has modbus libraries and code implementations on github if you want to write and modify your own modbus functions