Try this code:
def myfuncSplit(row,col,myList):
RBig = []
cou=-1
for i in range(row):
RSmall= []
for j in range(col):
cou+=1
RSmall.append(myList[cou])
RBig.append(RSmall[:])
return RBig
if __name__== '__main__':
myString = ['hi','my','name','is','Jeff']
result = myfuncSplit(2,2,myString)
print result
On 6/6/05, Jeff Peery <[EMAIL PROTECTED]> wrote:
> Hello, I'm having a bit of trouble resizing/reshaping an array of strings.
> here's what I'm trying to do:
>
> myString = ['hi','my','name','is','Jeff']
> reshape(myString, (2,2))
>
> What I get from this is something like:
>
> [['h','i'],
> ['m','y']]
>
> What I want is:
> [['hi','my'],
> ['name','is']]
>
> How might this work best?
> _______________________________________________
> Tutor maillist - [email protected]
> http://mail.python.org/mailman/listinfo/tutor
>
>
>
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor