On Tue, 2003-08-05 at 15:22, Bj�rn Lundin wrote:
> 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
Bjorn (sorry can't do the accent on your name)
It works... just need to make sure it doesn't add the new line and
I've got the number I need to be able to do what I want ... thanks
loads. BTW the app this will go into is here.
http://kde-look.org/content/show.php?content=7286
James
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com