typeerror: expected int, got slice

Pertanyaan typeerror: expected int, got slice

  • 15 Nopember 2011 23:59
     
     

    I am using sho from visual studio with the python tools

    The following code fails in the second line:

    x = DoubleArray(10, 5)

    print x[0, :]

    The error message is:

    typerror: expected int, got slice

    When I type the same code in the sho console it works perfectly.

    Can you help me figure out what is the problem?

     

    Thanks,

Semua Balasan

  • 16 Nopember 2011 23:50
     
     

    how come that DoubleArray is a valid name at the first place? I would assume that

     

      import sho

      x = sho.DoubleArray(10, 5)

      print x[0, :]

     

    should work?