if __name__=='__main__': filename=raw_input('Please enter a filename:\n') f=open(filename,'w') printFile(f,'1') printFile(f,'2') printFile(f,'Thx') f.close()
是不是这样的意思?
第3个回答 2019-06-11
下载 activepython ,然后引用系统自带的 microsoft script object,新建一个脚本引擎对象,设置language属性为python,然后就可以利用 addcode 添加或执行任意python代码了,也可以利用eval或executestatement调用py函数