示例#1
0
 def writefile(self, fpath):
     with open(fpath,'w+') as f:
         f.write(self.contour.getInstruct())
         f.write('\n')
         for c in self.content:
             if type(c) is str:
                 f.write("# "+c)
             else:
                 cnt = Contour()
                 cnt.points = c
                 cnt.origin = c[0]
                 f.write(cnt.getInstruct())
             f.write('\n')
         f.write('$ fixed components end and drag ones begin\n')
         for b in self.buff:
             f.write(b[1])
             f.write(b[0].getInstruct(False))
             f.write('\n')