Python - generate the time difference
<p>I am trying to generate a report for the usage statistics.Below is the sample data that i have in in an array and this is fetched from Mysql table.How to implement a logic saying that if the user is idle for more than 30 minutes he has not used the system else calculate the time mean time of the usage.</p>

<pre><code>timestamp=[]
for i in timestamp:
   print i 

        2010-04-20 10:07:30
        2010-04-20 10:07:38
        2010-04-20 10:07:52
        2010-04-20 10:08:22
        2010-04-20 10:08:22
        2010-04-20 10:09:46
        2010-04-20 10:10:37
        2010-04-20 10:10:58
        2010-04-20 10:11:50
        2010-04-20 10:12:13
        2010-04-20 10:12:13
        2010-04-20 10:25:38
        2010-04-20 10:26:01
        2010-04-20 10:26:01
        2010-04-20 10:26:06
        2010-04-20 10:26:29
        2010-04-20 10:26:29
        2010-04-20 10:26:35
        2010-04-20 10:27:21
        2010-04-20 01:32:46
        2010-04-20 01:32:47
        2010-04-20 01:32:57
        2010-04-20 01:32:59
        2010-04-20 01:33:03
        2010-04-20 01:33:03
        2010-04-20 01:33:05
        2010-04-20 01:33:11
        2010-04-20 01:33:15
        2010-04-20 01:34:49
        2010-04-20 01:34:55
        2010-04-20 01:35:02
        2010-04-20 01:35:17
        2010-04-20 01:35:20
        2010-04-20 01:36:49
        2010-04-20 01:36:52
        2010-04-20 01:36:52
        2010-04-20 01:37:11
        2010-04-20 01:37:15
        2010-04-20 01:37:17
        2010-04-20 01:50:11
        2010-04-20 01:50:15
        2010-04-20 01:50:18
        2010-04-20 01:50:20
        2010-04-20 01:50:33
        2010-04-20 01:50:36
        2010-04-20 01:51:56
</code></pre>
