f = 'D:\\MarsGisPlatform\\data\\3dtiles\\小学-机电合模\\1\\0\\0\\0\\0\\0.b3dm' print(f[f.rfind(".") + 1:]) # b3dm