windows - Python COM object , won't save numpy array -
i have simple com object setup in python, want see inputs coming in , have them transferred array want save text file can read it.
but com object performing usual skips on numpy save command.
here code
class pythonutilities(object): _public_methods_=['function'] # # use pythoncom.createguid() 2/1/08 # _reg_clsid_= pythoncom.createguid() _reg_desc_ = "utilities extending amibroker afl" _reg_progid_ = "example1" _readonly_attrs_ = ['revision'] _public_attrs_=['ndepvar','arraylen','probarray', 'x_open','x_high','x_low','x_close', 'x_volume','x_oi','log'] def function(self,inlist): # example infinite impulse response filter amibroker docs # inlist=list(inlist) a=[] if inlist == 0: inlist = [10,10,10,7,7,7,7] a=np.asarray(inlist) np.savetxt("inlint1.txt" , a, fmt='%.18e', delimiter=', ', newline='\n') return inlist if __name__=='__main__': print "registering com server " import win32com.server.register win32com.server.register.usecommandline(pythonutilities)
why np.savetxt not executing ??
Comments
Post a Comment