Some use of string formatting but could be more,not so nice
if that's no problem then use f-string.
+ ' ' +
.f-string
makes it a lot nicer,that will of course make it 3.6 only.if that's no problem then use f-string.
# You run_command('mv ' + path + ' ' + path + '.old') # f-string run_command(f'mv {path} {path}.old') # format() <-- 3.5 run_command('mv {0} {1}.old'.format(path, path))
with open()
can be written in one statement,some like this as some not.with open(path) as infile,open(f'{path}.new', 'w') as outfile: ...