Question: I don't have the plc connected to an opc server still I want real time data from the plc in any format. I want the timer's ACC data which I have to process on it further. How can I? please give steps of it cuz I'm new user of plc. I have micrologix 1400 plc from allen Bradley.

Answer: 
```
from itertools import combinations

def get_all_combinations(input_list):
    for i in xrange(len(input_list)):
        for item in combinations(input_list, r = i + 1):
            yield list(item)    

input_list = [1,4,6,8,11,13]
for item in get_all_combinations(input_list):
    print item

```

We have created a generator, so it is efficient as we don't have to store the entire combinations in memory. It is important for a combinations generator, because, often the number of combinations is very big.

But if you want to get all the combinations as list, then you can do

```
list(get_all_combinations(input_list))
# [[1], [4], [6], [8], [11], [13], [1, 4], [1, 6], [1, 8], [1, 11], [1, 13],..]

```
as a list: 

```
[i for j in xrange(len(l)) for i in itertools.combinations(l, j+1)]

```

or as a generator: 

```
(i for j in xrange(len(l)) for i in itertools.combinations(l, j+1))

```