Q: finding distance between 2 time's

jkv jkv at unixcluster.dk
Sat May 30 17:37:50 EDT 2009


martin at hvidberg.net wrote:
> Thanks both
>
> The first answer is quite instuctive, the other one might be the one
> I'll use in t
I didn't receive the other answer, could you please forward it to me?
> So 2x thanks.
You are welcome.

I took another look at your code, and you can compress it all to a if
"oneliner":
(and thanks to Steven for the <= reminder)

        if os.path.isfile(x):
            nSize = os.path.getsize(x)
            #if oneliner
            if time.mktime(time.localtime()) -
time.mktime(time.localtime(os.path.getmtime(x))) <= 3600:
              print ('HT fil -> %s %d @ %s') % (x, nSize, time.asctime)




More information about the Python-list mailing list