typeerror: expected int, got slice


  • 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?



    2011년 11월 15일 화요일 오후 11:59

모든 응답

  • 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?

    2011년 11월 16일 수요일 오후 11:50