i tried adding the -w flag in different ways pointing to the wallet file but it kept throwing syntax errors.
Try changing this:
i,o,t = Open3.popen2e($electrum, "-o", "getseed")
To this:
i,o,t = Open3.popen2e($electrum, "-w", "electrum.dat", "-o", "getseed")
Or this:
i,o,t = Open3.popen2e($electrum, "-w", 'C:\Users\Admin\Desktop\Brute\electrum.dat', "-o", "getseed")