I'm using the subprocess module to write large files to a usb flash drive like so:
import subprocess
subprocess.Popen("diskutil unMount /dev/diskX", shell=True)
subprocess.Popen("sudo dd if='file_name' of='/dev/diskX'", shell=True)
Ultimately, I just want to add in a line that fetches the % complete every few seconds so I can see how quickly it is going for very large transfers
I know when I run this command in terminal that I can type "SIGINFO" and press "Ctrl+T" while it is transferring to get the amount transferred but I don't know to convert that into a Python script.
I'm making the transfer after unmounting the disk so I can't just query the drives new files as they transfer and compare that as a % against the original file size.