James Sparenberg wrote: > Perhaps it would be best offline dunno. But would anyone know the > python equivalent to > > grep Number "$HOME/.kde/share/config/kdeglobals" | awk -F= '{print $2;}' > > For the life of me I'm stumped... but that's no great accomplishment. > Sorry if it's a bit OT but I don't have any visible friends who know > python. *grin* > > James
Just starting off with python myself! Here's one, proberbly clumpsy, way of doing it #!/usr/bin/python import os f=file(os.path.expanduser('~/.kde/share/config/kdeglobals')) All_Words=f.readlines() for i in range(len(All_Words)): Words=All_Words.pop().split('=') Words.reverse() if Words.pop() == "Number": print Words.pop() f.close() /Björn
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com