Get rid of recursive call __getattr__
How can I get rid of recursive call __getattr__ inside this method, if i need to use method or property of the class? -- http://mail.python.org/mailman/listinfo/python-list
Re: Get rid of recursive call __getattr__
thanks, i should been read more closely -- http://mail.python.org/mailman/listinfo/python-list
Re: Get rid of recursive call __getattr__
thanks, i understood my mistake i try to get attribute, that wasn't defined -- http://mail.python.org/mailman/listinfo/python-list
Re: Get rid of recursive call __getattr__
as __repr__ for example? -- http://mail.python.org/mailman/listinfo/python-list
Re: Get rid of recursive call __getattr__
thanks, i found the problem -- http://mail.python.org/mailman/listinfo/python-list
Re: Get rid of recursive call __getattr__
>>> class Test: def __getattr__(self, attr): print attr def foo(x): print x >>> t = Test() >>> print t __str__ Traceback (most recent call last): File "", line 1, in -toplevel- print t TypeError: 'NoneType' object is not callable what i have to do? define __str__ explicitly? -- http://mail.python.org/mailman/listinfo/python-list
Re: Get rid of recursive call __getattr__
thanks, now all clear -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple (?) question about print statement
>From doc: range( [start,] stop[, step]) This is a versatile function to create lists containing arithmetic progressions. It is most often used in for loops. The arguments must be plain integers. If the step argument is omitted, it defaults to 1. If the start argument is omitted, it defaults to 0. The full form returns a list of plain integers [start, start + step, start + 2 * step, ...]. If step is positive, the last element is the largest start + i * step less than stop; if step is negative, the last element is the smallest start + i * step greater than stop. step must not be zero (or else ValueError is raised). -- http://mail.python.org/mailman/listinfo/python-list
Re: Simple (?) question about print statement
sorry ... i don'understand a question from first read my previos aswer is not an aswer at all -- http://mail.python.org/mailman/listinfo/python-list
Can I use win32 COM object in a thread?
When I try to call a method of COM object, it return error about "There wasn't 'CoInitialize' call", or if I use thread, I have to access COM object methods in other way? thanks for any help -- http://mail.python.org/mailman/listinfo/python-list
Re: Can I use win32 COM object in a thread?
Sorry for post, answer was near ... just do search 2. Ixokai From: "Ixokai" <[EMAIL PROTECTED]> Mon, 9 Feb 2004 11:05:08 -0800 Basically, adodbapi uses COM, and COM and threads require a bit of care, apparently. Your webkit thing may be using a thread to handle stuff. import pythoncom pythoncom.CoInitialize() ... code ... pythoncom.CoUnitialize() You need to call pythoncom.CoInitialize() once for each thread... theres something about sys.coinit_flags = 0 (or 1) that may be nessecary but I don't know what they mean precisely :) --Stephen -- http://mail.python.org/mailman/listinfo/python-list
Re: Problem with os.path
sorry? if i'm wrong? but i'm think you have to use double slash, to prevent escape-interpreting as '\n' for example -- http://mail.python.org/mailman/listinfo/python-list
Cp1251-symbols in SOAP request
in short >>> doc = SOAPpy.SOAPProxy('localhost:8000', 'urn:Server', encoding='cp1251') >>> doc.invoke('НомерДок'.decode('cp1251'), ()) *** Outgoing SOAP ** http://schemas.xmlsoap.org/soap/encoding/"; xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; > Traceback (most recent call last): File "", line 1, in -toplevel- doc.invoke('НомерДок'.decode('cp1251'), ()) File "C:\Python24\lib\site-packages\SOAPpy\Client.py", line 322, in invoke return self.__call(method, args, {}) File "C:\Python24\lib\site-packages\SOAPpy\Client.py", line 364, in __call config = self.config) File "C:\Python24\lib\site-packages\SOAPpy\Client.py", line 196, in call r.endheaders() File "C:\Python24\lib\httplib.py", line 795, in endheaders self._send_output() File "C:\Python24\lib\httplib.py", line 676, in _send_output self.send(msg) File "C:\Python24\lib\httplib.py", line 655, in send self.sock.sendall(str) File "", line 1, in sendall UnicodeEncodeError: 'ascii' codec can't encode characters in position 161-168: ordinal not in range(128) How can i force this problem. Thanks. -- http://mail.python.org/mailman/listinfo/python-list
Re: Cp1251-symbols in SOAP request
what to do, to encode it properly? UTF-8? -- http://mail.python.org/mailman/listinfo/python-list
Re: Cp1251-symbols in SOAP request
as i understood, better way is base64 encoding on my side, and decoding on server side? -- http://mail.python.org/mailman/listinfo/python-list
Re: Cp1251-symbols in SOAP request
thanks ... it seems to me best way will be b16encode, to prevent sax parser errors -- http://mail.python.org/mailman/listinfo/python-list
Re: Cp1251-symbols in SOAP request
but socket will raise an exception if it'll be in cp1251 -- http://mail.python.org/mailman/listinfo/python-list
Re: attach a pdf file to an email
here is my code for Excel outer = MIMEMultipart() outer['Subject'] = header.decode('cp1251').encode('koi8-r') outer['To'] = baseParam['mailto'] outer['From'] = baseParam['mailfrom'] outer.preamble = '' # To guarantee the message ends with a newline outer.epilogue = '' outer.attach(MIMEText('Weekly report', 'plain', 'koi8-r')) fp = open(reportFileName, 'rb') msg = MIMEBase('application', 'octet-stream') msg.set_payload(fp.read()) fp.close() # Encode the payload using Base64 Encoders.encode_base64(msg) # Set the filename parameter msg.add_header('Content-Disposition', 'attachment', filename=header.decode('cp1251').encode('koi8-r') + '.xls') outer.attach(msg) server = smtplib.SMTP(baseParam['server'], baseParam['port'], 'localhost') #server.set_debuglevel(1) server.sendmail(baseParam['mailfrom'], baseParam['mailto'], outer.as_string()) server.quit() -- http://mail.python.org/mailman/listinfo/python-list
Re: Subclassing socket
imho: class new_socket(socket): def __init__(self, family=AF_INET, type=SOCK_STREAM, proto=0, _sock=None) socket.__init__(self, family=AF_INET, type=SOCK_STREAM, proto=0, _sock=None) def accept( self ): conn, addr = socket.accept() return ( new_socket(_sock=conn), addr ) but i think your problem have a more simple way then inheritance -- http://mail.python.org/mailman/listinfo/python-list
Re: Why my thread can't access the global data?
your main loop already on accept when your thread change the go_on imho try to input another string after 'quit' and actually there is no need to use thread -- http://mail.python.org/mailman/listinfo/python-list