Use string formatting and now should use f-string.
Example using your working command and put in variables.
Example using your working command and put in variables.
>>> first = '/var/www/html/LifeSaverHTML/eg,h264' >>> last = '/var/www/html/LifeSaverHTML/eg.mp4' >>> command = f"MP4Box -add '{first}' '{last}'" >>> print(command) MP4Box -add '/var/www/html/LifeSaverHTML/eg,h264' '/var/www/html/LifeSaverHTML/eg.mp4' >>> >>> #Assign to a variable the command is like this >>> print(repr(command)) "MP4Box -add '/var/www/html/LifeSaverHTML/eg,h264' '/var/www/html/LifeSaverHTML/eg.mp4'"