I'm trying to convert a file from .m4a to .mp3 using ffmpeg and I need to access to the music folder.
The path name of this folder is : C:\\Users\A B\Desktop\Music
I can't access it with subprocess.call() because only C:\\Users\A gets recognized. The white space is not processed.
Here's my python script :
import constants import os import subprocess path = 'C:\\Users\A B\Desktop\Music' def main(): files = sorted(os.listdir(path), key=lambda x: os.path.getctime(os.path.join(path, x))) if "Thumbs.db" in files: files.remove("Thumbs.db") for f in files: if f.lower()[-3:] == "m4a": process(f) def process(f): inFile = f outFile = f[:-3] + "mp3" subprocess.call('ffmpeg -i {} {} {}'.format('C:\\Users\A B\Desktop\Music', inFile, outFile)) main() When I run it I get an error that states :
C:\Users\A: No such file or directory
I wonder if someones knows how to put my full path name (C:\Users\A B\Desktop\Music) in subprocess.call() ?