#!H:\Sublime_work\Python_work
# -*- coding:utf-8 -*-
#we can use cmd to control our python programm if we have upper line
# we can write with chinese if we have upper line
"""
脚本第一行一定要写上 #!usr/bin/python
表示该脚本文件是可执行python脚本
如果您的python目录不在usr/bin目录下,则替换成当前python执行程序的目录
"""
"""
The stl_to_xml transfer thought is that input the header, body and trailer to the new file
"""
def stl2xml():
#get all the file names in the folder
import os
#os.getcwd() get the current working directory
# the place os.getcwd() can put any directory you want to do
filenames = os.listdir(os.getcwd()) #all the filenames in the current folder
for filename in filenames:
if '.stl' in filename: #only get .stl file
file_output_xml = filename.strip('.stl') + '.xml' #output file name
"""
this is equiveland with:
with open(filename) as file_object:
contents
stl2xml.py 代码实现了stl格式转化为xml格式
最新推荐文章于 2024-09-24 08:16:06 发布