How to replace (or strip) an extension from a filename in Python?,print(os.path.splitext('/home/user/somefile.txt')[0] + '.jpg')