直接上代码:
import easygui import os s4 = [] s6 = [] path = easygui.fileopenbox() if path: b = os.path.splitext(path) c = [b[0], ‘_trace‘, ‘.xyz‘] d = ‘‘.join(c) with open(d, ‘w+‘) as f1: with open(path, ‘r‘, encoding=‘utf-8‘) as f: for line in f: s1 = line.strip() s2 = (s1.strip().split(‘ ‘)[-6:-3][::-1]) s3 = ‘ ‘.join(s2) f1.writelines(s3) f1.writelines(‘\n‘)
原文地址:https://www.cnblogs.com/yibeimingyue/p/10041461.html
时间: 2024-10-11 06:29:17