Instance method for converting int to str - str() and __str__()

2015-10-03 Thread neubyr
I was wondering if there is any resource that explains why certain methods like str() and type() were implemented the way they are, rather than .to_string() or .type() instance/object methods. I find instance/object methods more intuitive for this cases, but I am wondering why it wasn't

sys path modification

2015-07-27 Thread neubyr
I am trying to understand sys.path working and best practices for managing it within a program or script. Is it fine to modify sys.path using sys.path.insert(0, EXT_MODULES_DIR)? One stackoverflow answer - http://stackoverflow.com/a/10097543 - suggests that it may break external 3'rd party code as

Re: sys path modification

2015-07-27 Thread neubyr
, 2015 at 1:24:50 PM UTC-4, neubyr wrote: I am trying to understand sys.path working and best practices for managing it within a program or script. Is it fine to modify sys.path using sys.path.insert(0, EXT_MODULES_DIR)? One stackoverflow answer - http://stackoverflow.com/a/10097543 - suggests

Re: MIMEText encode error - Python 2.6.6

2011-09-07 Thread neubyr
On Tue, Sep 6, 2011 at 5:05 PM, MRAB pyt...@mrabarnett.plus.com wrote: On 06/09/2011 22:52, neubyr wrote: I am trying to write a program which can email file's content using smtplib. I am getting following error while using Python 2.6.6 version. {{{ File ./killed_jobs.py, line 88

MIMEText encode error - Python 2.6.6

2011-09-06 Thread neubyr
I am trying to write a program which can email file's content using smtplib. I am getting following error while using Python 2.6.6 version. {{{ File ./killed_jobs.py, line 88, in sendmail msg = MIMEText(ipfile.read, 'plain') File /home/ssp/sge/python/2.6.6/lib/python2.6/email/mime/text.py,