Python写txt

import sys
imageJPath = r'D:/Softwares/fiji-win64/Fiji.app'
sys.path.append(imageJPath)


import os
# print(os.system('ping www.baidu.com'))

if os.path.exists()


curImg = r'D:/Data/Aloe512.png' # image path
macro2 ='open("' + curImg + '");' + 'run("ROI Manager...");' #macro 内容
ijmPath = r'D:/PythonProject/NakedSomaToolPython/resources/results2.ijm'

with open(ijmPath, "w") as f:
    f.write(macro2)

# cmd = 'ImageJ-win64 ' + '-macro ' + r'D:/PythonProject/NakedSomaToolPython/resources/results.ijm'

cmd = 'ImageJ-win64 ' + '-macro ' + ijmPath
print(os.system(cmd))

 

with open(ijmPath, "w") as f:

f.write(macro2)

©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页