#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 19 18:53:47 2018
@author: bdf
"""
import os
# 列出当前目录下所有的文件
files = os.listdir('.')
#print('files',files)
for filename in files:
portion = os.path.splitext(filename)
# 如果后缀是.SSM
if portion[1] == ".SSM":
# 重新组合文件名和后缀名
newname = portion[0] + ".txt"
os.rename(filename,newname)