Re: environment fingerprint

2013-01-29 Thread Chris Angelico
On Wed, Jan 30, 2013 at 10:33 AM, Jabba Laci wrote: > if md5: > md5 = hashlib.md5() > md5.update(text) > return md5.hexdigest() Simpler: if md5: return hashlib.md5(text).hexdigest() ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: environment fingerprint

2013-01-29 Thread Jabba Laci
Hi, Thanks for the tip. I came up with the solution below. For my purposes the short fingerprint is enough. Laszlo == import platform as p import uuid import hashlib def get_fingerprint(md5=False): """ Fingerprint of the current operating system/platform. If md5 is True, a digital fin

Re: environment fingerprint

2013-01-29 Thread Andrew Berg
On 2013.01.29 07:18, Jabba Laci wrote: > Hi, > > I have a script that I want to run in different environments: on > Linux, on Windows, on my home machine, at my workplace, in virtualbox, > etc. In each environment I want to use different configurations. For > instance the temp. directory on Linux