Re: Wrapping around a list in Python.

2013-12-16 Thread Peter Otten
shengjie.sheng...@live.com wrote: The idea is to grab the last 4 elements of the array. However i have an array that contains a few hundred elements in it. And the values continues to .append over time. How would i be able to display the last 4 elements of the array under such a condition?

Re: Wrapping around a list in Python.

2013-12-16 Thread Mark Lawrence
On 16/12/2013 05:10, shengjie.sheng...@live.com wrote: On Monday, 16 December 2013 13:07:46 UTC+8, shengjie...@live.com wrote: Would you please read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing double line spacing, thanks. -- My fellow Pythonistas,

Re: Wrapping around a list in Python.

2013-12-16 Thread Denis McMahon
On Mon, 16 Dec 2013 15:59:32 +1100, Ben Finney wrote: shengjie.sheng...@live.com writes: Hi guys, I am trying to create a fixed list which would allow my values to be wrapped around it. This doesn't make a lot of sense to me, but I assume you have a purpose in mind for this. What is the

Re: Wrapping around a list in Python.

2013-12-16 Thread David Robinow
On Mon, Dec 16, 2013 at 12:26 AM, shengjie.sheng...@live.com wrote: The idea is to grab the last 4 elements of the array. However i have an array that contains a few hundred elements in it. And the values continues to .append over time. How would i be able to display the last 4 elements of

Re: Wrapping around a list in Python.

2013-12-16 Thread Dave Angel
On Sun, 15 Dec 2013 21:26:49 -0800 (PST), shengjie.sheng...@live.com wrote: The idea is to grab the last 4 elements of the array. However i have an array that contains a few hundred elements in it. And the values continues to .append over time. How would i be able to display the last 4

Wrapping around a list in Python.

2013-12-15 Thread shengjie . shengjie
Hi guys, I am trying to create a fixed list which would allow my values to be wrapped around it. For example i have 10 values : 0,1,2,3,4,5,6,7,8,9 I need to create a list which contains 4 numbers and when the number exceeds the list, it would overwrite the first value. [0,1,2,3] [4,1,2,3]

Re: Wrapping around a list in Python.

2013-12-15 Thread Ben Finney
shengjie.sheng...@live.com writes: Hi guys, I am trying to create a fixed list which would allow my values to be wrapped around it. This doesn't make a lot of sense to me, but I assume you have a purpose in mind for this. What is the purpose? Perhaps it will help the explanation if we know

Re: Wrapping around a list in Python.

2013-12-15 Thread shengjie . shengjie
On Monday, 16 December 2013 12:59:32 UTC+8, Ben Finney wrote: shengjie.sheng...@live.com writes: Hi guys, I am trying to create a fixed list which would allow my values to be wrapped around it. This doesn't make a lot of sense to me, but I assume you have a purpose in mind

Re: Wrapping around a list in Python.

2013-12-15 Thread shengjie . shengjie
On Monday, 16 December 2013 13:07:46 UTC+8, shengjie...@live.com wrote: On Monday, 16 December 2013 12:59:32 UTC+8, Ben Finney wrote: shengjie.sheng...@live.com writes: Hi guys, I am trying to create a fixed list which would allow my values to be wrapped around

Re: Wrapping around a list in Python.

2013-12-15 Thread Gary Herron
On 12/15/2013 08:38 PM, shengjie.sheng...@live.com wrote: Hi guys, I am trying to create a fixed list which would allow my values to be wrapped around it. For example i have 10 values : 0,1,2,3,4,5,6,7,8,9 I need to create a list which contains 4 numbers and when the number exceeds the list,

Re: Wrapping around a list in Python.

2013-12-15 Thread shengjie . shengjie
On Monday, 16 December 2013 13:10:22 UTC+8, Gary Herron wrote: On 12/15/2013 08:38 PM, shengjie.sheng...@live.com wrote: Hi guys, I am trying to create a fixed list which would allow my values to be wrapped around it. For example i have 10 values : 0,1,2,3,4,5,6,7,8,9 I need to

Re: Wrapping around a list in Python.

2013-12-15 Thread shengjie . shengjie
On Monday, 16 December 2013 12:38:14 UTC+8, shengjie...@live.com wrote: Hi guys, I am trying to create a fixed list which would allow my values to be wrapped around it. For example i have 10 values : 0,1,2,3,4,5,6,7,8,9 I need to create a list which contains 4 numbers and when the number