From zlotchen@cs.utk.edu Mon Jul 21 10:53:25 1997 I did not get experienced so to work with comand line args. I did not see any casting. But type is more or less defined by use. It does not matter what you pass to a function. It matters how you use what you pass. x[:len(x)-1] may generate an array or generate an arror when len(x) == 0. BTW, I think x[:len(x)-1] is equalent to x[:-1]. passing subslices workes for me. Just watch for lenghthes. > David ... is there a method to cast a variable to a specific type in > python? I am trying to use a variable, passed as an input argument, to > the specification in a slice field, but I keep getting an error that > indicates the variable is not an integer (or maybe it is telling me that > I must use an integer in the slice specification, not a variable ... but > you can use something like x[:len(x)-1] so I expected to be able to use > x[:key] where key had been previously passed as a command line argument. > -- -- David Zlotchenko Phone: (01) (423) 974-6601 Research Services Email: zlotchen@utk.edu The University of Tennessee URL: http://www.oars.utk.edu/~zlotchen