TEST=`which test` equivalent in python?

2009-01-24 Thread Jay Jesus Amorin
Hi, Kindly help. import sys, os, string *SVNLOOK_PATH=os.system('which svnlook')* def main(repos, txn): svnlook_cmd = '%s log -t "%s" "%s"' % (*SVNLOOK_PATH*, txn, repos) check_msg = os.popen(svnlook_cmd, 'r').readline().rstrip('\n') if len(check_msg) < 10: sys.stderr.write

AttributeError: 'module' object has no attribute 'open_workbook'

2009-01-26 Thread Jay Jesus Amorin
Hi, Kindly help, I've got this error when running my script: AttributeError: 'module' object has no attribute 'open_workbook' Here's my code: #!/usr/bin/python import xlrd import sys mySpreadsheet = xlrd.open_workbook(open(sys.argv[1])) firstSheet = wb.sheet_by_index(0) for myRows in range(

[xlrd] sanitize the output and store in a 2d arrays

2009-01-27 Thread Jay Jesus Amorin
Hi gurus, Script: #!/usr/bin/python import xlrd, sys def main(toParse): workBook = xlrd.open_workbook(toParse) mySheet = workBook.sheet_by_index(0) for rownum in range(mySheet.nrows): print mySheet.row_values(rownum) if __name__ == '__main__': if len(sys.argv) < 2:

python to parse excel file csv format

2008-12-03 Thread Jay Jesus Amorin
Hi all, Can anyone please help me. i need to parse the content of my csv excel file and run the unix command chown. test.csv: "/dev/trunk/admin/sql/ADBPOS_CMSI_NATIONALITY.syn",814 "/dev/trunk/bin/ADBPOSCMSDICED.ctl",405 "/dev/trunk/discoverer/ADBPOS_BUSINESS_AREA.eex",215 Please help me parse

Re: python to parse excel file csv format

2008-12-03 Thread Jay Jesus Amorin
te2prod.py", line 12, in ? sys.exit('file %s, line %d: %s' % (filename, reader.line_num, e)) AttributeError: '_csv.reader' object has no attribute 'line_num' On Thu, Dec 4, 2008 at 2:25 AM, Jay Jesus Amorin <[EMAIL PROTECTED]>wrote: > Hi all, > &

Re: python to parse excel file csv format

2008-12-04 Thread Jay Jesus Amorin
equired Please help I'm a complete newbie to python. Many thanks. Jay On Thu, Dec 4, 2008 at 4:32 AM, Tino Wildenhain <[EMAIL PROTECTED]> wrote: > MRAB wrote: > >> Jay Jesus Amorin wrote: >> >>> This is how i do it, but it runs with error. Kindl