The first argument to subprocess.run is the list of arguments. You're not passing them as a list. The second argument (optional) is bufsize. Your second argument of '-vp' isn't an integer, so it complains about it at that point.
Also, you can't enter the elif sections unless you've failed the previous if/elifs. So for instance in the first elif, you already know that filesize must be < 16, so you don't have to check for it again.
#Incorrect subprocess.run('/bin/ls', 'myfile') #Correct subprocess.run(['bin/ls', 'myfile'])
Also, you can't enter the elif sections unless you've failed the previous if/elifs. So for instance in the first elif, you already know that filesize must be < 16, so you don't have to check for it again.
# Equivalent to above: if filesize_gb >= 16: piece_size = 24 elif filesize_gb >= 8: piece_size = 23 elif filesize_gb >= 4: piece_size = 22 elif filesize_gb >= 2: piece_size = 21 ...