python apt help

2011-08-22 Thread Smaine Kahlouch
Hi, I'm trying to use the apt_pkg module but it seems to me really hard and i didn't find samples for what i'm trying to do. Actually it should be simple : - Installing a package like 'aptitude install mypackage' - test if a package is already installed Thank you all for your help, Sam --

Re: Linux : create a user if not exists

2011-08-16 Thread Smaine Kahlouch
Le 16/08/2011 17:56, Alexander Kapps a écrit : On 16.08.2011 16:57, smain kahlouch wrote: Ok than you. You're right but it doesn't help me : I replaced it : def finduser(user): ... if pwd.getpwnam(user): ... print user, user exists ... return True ... return