Re: [python-win32] PythonWin And Excel Problem

2006-12-01 Thread Smith, Brian (CR)
Hi Andrea, > therand = [] > for ii in xrange(10): > therand.append(random.random()) > ... > sheet.Range("A1:A10").Value = therand I believe that when setting the value for a range, you must supply a list of row data, where each piece of row data is a list of column data. In other words, a l

Re: [python-win32] PythonWin And Excel Problem

2006-12-01 Thread Michael S
Andrea, Also, could it be that when you do the following: sheet.Range("A1:A10").Value = therand you actually initialize all 10 cells to the first element of the array? Try to iterate and initialize every cell separately. Michael --- Andrea Gavana <[EMAIL PROTECTED]> wrote: > Hi All, > > I

Re: [python-win32] PythonWin And Excel Problem

2006-12-01 Thread Michael S
First of all you should call the random.seed() function. That was at least what I´ve always done. seed([x]) Initialize the basic random number generator. Second of all, calling random.random() will give you this: random() Return the next random floating point number in the range [0.0, 1.0

[python-win32] PythonWin And Excel Problem

2006-12-01 Thread Andrea Gavana
Hi All, I am having some problems in running a very simple python script, which prints some numbers in an Excel spreadsheet. The numbers are stored in a list. I know that the numbers are different (random generated), but when I open the Excel file I get a column of data with all the numbers eq