As of now, i’m looking for a job 2006 May 22 16:13
Posted by diamond in : Work , 1 comment so farI’ve had a chat with mikael, and i’ve told him that i hope to get all the practical stuff done for my masters in the next 3-4 months. After that, i’m out of here, and into the real world. I’ll be sending my cv into google as soon as that dredg fella gets back from the land-beyond-the-internet. I’ll probably apply to heanet too. I’m looking forward to getting back into a ‘real’ job.
Python regexs and named back-references
Posted by diamond in : Random , add a commentNifty python feature i found this morning:
import re
a = r’/dev/disk1s1 on /Volumes/NO NAME (local, read-only)’
rx = re.compile(r’^(?P<dev>/\w+/\w+) on (?P<mount>.*) \(‘)
m = rx.search(a)
dev_name = m.group(‘dev’) #dev_name now contains ‘/dev/disk1s1′
mount_point = m.group(‘mount’) #mount_point now contains ‘/Volumes/NO NAME’
*Update*
Oops. Just realised that wordpress ate the ‘<dev>’ and ‘<mount>’ bits from the re.compile() statement. Fixed.