| 33 | self.file.write(" "*self.__indent+s+os.linesep) |
| 34 | |
| 35 | class Vector: |
| 36 | def __init__(self,*args): |
| 37 | if len(args) == 1: |
| 38 | self.v = args[0] |
| 39 | else: |
| 40 | self.v = args |
| 41 | def __str__(self): |
| 42 | return "<%s>"%(", ".join([str(x)for x in self.v])) |
| 43 | def __repr__(self): |
| 44 | return "Vector(%s)"%self.v |
| 45 | def __mul__(self,other): |
| 46 | return Vector( [r*other for r in self.v] ) |
| 47 | def __rmul__(self,other): |
| 48 | return Vector( [r*other for r in self.v] ) |
| 49 | |
| 50 | class Item: |
| 51 | def __init__(self,name,args=[],opts=[],**kwargs): |