Why am i getting an error: “buffsize musth be an integer”
afer this line:
pid2 = subprocess.Popen(["mv"],glob.glob(os.path.basename(filename)+'[0-9]*'),folder);
It is a simply mv command with a blog shell expansion .
I want sth like mv filename[0-9]* folder
First of all, it’s Python, so you don’t need a semi-colon at the end of a line. Then, what you want is to supply one argument, i.e.
Otherwise, you’re specifying the result of
glob.globas the second argument (bufsize) ofsubprocess.Popen.Also note that calling
mvis unnecessary, Python already has the functionality to move files implemented inshutil.move: