首页 > 编程语言 > 详细

Ansys采用后处理list Rusult输出位移时负号原因导致不能分列的python解决方法

时间:2021-05-04 18:02:05      阅读:26      评论:0      收藏:0      [点我收藏+]
‘‘‘
! ========== Creat Date: 2021-5-4 ==========
! ========== Author: xdd1997        ==========
! ========== Email: xdd2026@qq.com  ==========
‘‘‘

import re
#  ================ 输入文件 ================ # 接口  filePath = ‘D:\\Desktop\\uu.lis‘  也可以
filePath = rD:\Desktop\PRNSOL.lis
pathAndName = filePath.split(".")[0]
fileOutPath = pathAndName + _change.txt
# ================ 获取文件行数 ================
count = -1
for count, line in enumerate(open(filePath)):
    pass
count += 1
file_line = count
print(file_line)
# ================处理文件 ==================
kk =0
with open(filePath, r) as old_file:
    with open(fileOutPath, w) as new_file:
        for line in old_file.readlines():
             kk = kk + 1
             if ((kk>11) and (kk<(file_line-4))):
                 new_file.writelines(line[1:9] +   +line[9:21] +   + line[21:33] +   + line[33:57]+\n)

 

Ansys采用后处理list Rusult输出位移时负号原因导致不能分列的python解决方法

原文:https://www.cnblogs.com/xdd1997/p/14729525.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!