[Tutor] Sending Email
I have a turbogears app that needs to be able to send out email notifications to users. Just plain text, no attachments. Can anyone suggest some lightweight module? Maybe something Akin to Perl's MIME::Lite. Paul ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] pyexcelerator
Are their docs anywhere for pyexcelerator? the built in docs are a bit lacking.For instance I can't figure out how to set a column width.I am just reading the examples and they kind of help but I don't follow this ... ws.col(i).width = 0x0d00 + iwhere i is an incrementing integer.so to me it reads if i = 0.set col 0's width to hexnumber plus 0why the hex number? does it have to be written this way? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] pyexcelerator
Maybe just try without the 0x0d00 and see what happens? or try thepyExcelerator mailing list on SourceForge... Mailing list looks dead only 2 messages.Man this is the exact module i need to finish converting about 20 scripts from perl and I have no idea how to use most of it. This is very frustrating. Is there another excel writer module that has documentation?Or on a broader topic is their a CPAN equivalent? Paul ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] pyexcelerator
I just looked at my copy of PyExcelerator. It seems to be in poor shape.I tried running some of the modules that have if __name__ == '__main__': (i.e. self-testing) and they failed with errors! And I find no visibledocumentation or working examples. Sigh.You might want to check out the recent source from sourceforge its seems very functional and it has a bunch of examples. Not very useful for ones as far as I am concrened. I have not tried to run the modules by themselves.I hate the idea of having to pass or make a call to a perl script to handle the excel stuff its just seems wrong. I wish there was some kind of *open* format that i could write the spreadsheets to that both open office and excel 2000/2003 could read natively. Paul ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Function list that might have a tuple that might have one of its indexs set to 's'
I am writing my first python program(at least in a really long time). Its purpose is to take csv or pipe delimintaed files and convert them to html pages. Was going to be excel but its just not worth the headache. Everyone viewing the reports is doing just that viewing simple tables. I need to scan through a list that contains headers to my table.If one of the elements is a tuple and one of the elements of the tuple is s set self.sort to the index of the tuple in the header list and then replace the element in header with a two field tuple containing everything that was not 's'. header = ['my first column',('my second num column','s','r'),(' my third num column','r') ]I pass header to a function actually a method but lets pretend its just a plain old function. Be careful reading the below code may cause random strokes. I have woken up twice laying on the floor disoriented :) Actual code in my working example used to call function ...report.set_header( ['','Ext','Name','',('Calls','r','s'),('Ring','r'),('Talk','r'),('Wait','r'),('Max Talk','r') ] ) def set_header(self,header): list = [] for cindex in range(len(header)): if type(()) == type(header[cindex]): for index in range(len(header[cindex]) ): if header[cindex][index] == 's': self.sort = cindex for tindex in range(len(header[cindex])): if tindex != index: list.append(header[cindex][tindex]) header[cindex] = tuple(list) self.header = header ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Is there a better way to write this function?
This is a second... the first one never hit the list. *shrug* should i be using a different interface to post? is this a gateway to newsgroup?I am writing my first python program(at least in a really long time). Its purpose is to take csv or pipe delimintaed files and convert them to html pages. Was going to be excel but its just not worth the headache. Everyone viewing the reports is doing just that viewing simple tables. I need to scan through a list that contains headers to my table.If one of the elements is a tuple and one of the elements of the tuple is s set self.sort to the index of the tuple in the header list and then replace the element in header with a two field tuple containing everything that was not 's'. header = ['my first column',('my second num column','s','r'),(' my third num column','r') ]I pass header to a function actually a method but lets pretend its just a plain old function. Be careful reading the below code may cause random strokes. I have woken up twice laying on the floor disoriented :) Actual code in my working example used to call function ...report.set_header( ['','Ext','Name','',('Calls','r','s'),('Ring','r'),('Talk','r'),('Wait','r'),('Max Talk','r') ] ) def set_header(self,header): list = [] for cindex in range(len(header)): if type(()) == type(header[cindex]): for index in range(len(header[cindex]) ): if header[cindex][index] == 's': self.sort = cindex for tindex in range(len(header[cindex])): if tindex != index: list.append(header[cindex][tindex]) header[cindex] = tuple(list) self.header = header ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Function list that might have a tuple that might have one of its indexs set to 's'
I am writing my first python program(at least in a really long time). Its purpose is to take csv or pipe delimited files and convert them to html pages. Was going to be excel but its just not worth the headache. Everyone viewing the reports is doing just that viewing simple tables. I need to scan through a list that contains headers to my table.If one of the elements is a tuple and one of the elements of the tuple is s set self.sort to the index of the tuple in the header list and then replace the element in header with a two field tuple containing everything that was not 's'. header = ['my first column',('my second num column','s','r'),(' my third num column','r') ]I pass header to a function actually a method but lets pretend its just a plain old function. Be careful reading the below code may cause random strokes. I have woken up twice laying on the floor disoriented :) Actual code in my working example used to call function ...report.set_header( ['','Ext','Name','',('Calls','r','s'),('Ring','r'),('Talk','r'),('Wait','r'),('Max Talk','r') ] ) def set_header(self,header): list = [] for cindex in range(len(header)): if type(()) == type(header[cindex]): for index in range(len(header[cindex]) ): if header[cindex][index] == 's': self.sort = cindex for tindex in range(len(header[cindex])): if tindex != index: list.append(header[cindex][tindex]) header[cindex] = tuple(list) self.header = headerTIA,Paul ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Changing lists in place
I have a list that I want to change in a for loop. It changes in the loop but the changes are not persistant outside of the loop.I thought lists were mutuable objects so I am a bit confused.Sample Code#!/usr/bin/env python Testing lists mylist = [ 'One ', ' two', ' three ' ]print mylistfor element in mylist: element = element.strip() print + element + print mylistSample Output['One ', ' two', ' three ']Onetwothree['One ', ' two', ' three '] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor