No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hi, I am trying to create xl file using pyExcelerator in django. response = HttpResponse( mimetype='application/vnd.ms-excel') response['Content-Disposition'] = 'attachment; filename=output.xls' workbook = Workbook() worksheet = workbook.add_sheet('My Test Sheet') worksheet.write(0,0, 'Company', font_style('left', 1, 'red')) worksheet.write(1,1, 'Hello World!', font_style('left', 1, 'black')) workbook.save() return response The problem here is I am not able … | |
hi, I am using reportlab to generate pdf but having a problem in making list in tabular format. final list should be in this format: list =[ ['companies', 'industries'], ['1', '11'], ['2','22], ['3', '33'] ] data =[] data.append('companies') for item in some_list: data.insert(0, item) -> Assuming item gives me values … | |
Hi, I am having the problem in nested list. Here is the code : [code=python]data1= [['Contacts',company.contacts.count() ], ['Notes', company.notes.count()], ['Met by', ], ['Industry', industry], ['Financial Investors', '31']] for item in metlist: data1[2].insert(1,item) [/code] Basically I am trying to insert the value for Met by in [ 'Met by', metlist->value] I … | |
Hey, I am trying to create tuple but not able to do it. here is my code: datatuple =() for emailadd in mailing_list: datatuple((subject, message, sender, [emailadd])) send_mass_mail(datatuple) basically it should be in this format: datatuple = ( ('Subject', 'Message.', 'from@example.com', ['john@example.com']), ('Subject', 'Message.', 'from@example.com', ['jane@example.com']), ) so here my … | |
Hi I wanted to know how can I make sure that table exist in my database. [code] class Record: def __init__(self): self.conn = MySQLdb.connect( host = 'localhost', user = 'root', passwd = 'abcd', db = 'justfun') self.cursor = self.conn.cursor() self.cursor.execute("DROP TABLE IF EXISTS book") self.cursor.execute( """CREATE TABLE book (name char(40), … | |
Hi I wanted to know how can I delete class object inside list. class Record: def __init__(self): self.list = [] def add(self): fname = raw_input("First Name:> ") lname = raw_input("Last Name:> ") street = raw_input("Street:> ") self.list.append( Person( fname, lname, street)) Now I have added my Person object into the … | |
Hi I am new to python. So i am having problem while coding. Here the code import sys class Person: def __init__(self): self.list = [] def AddContact(self): fname = raw_input("First Name:> ") lname = raw_input("Last Name:> ") street = raw_input("Street:> ") self.list = [ fname, lname, street] def ListAll(self): print … |