[Tutor] Re: trouble with pygtk and different users

Daniel Ehrenberg littledanehren at yahoo.com
Sat Dec 20 20:36:07 EST 2003


Lee Harr wrote:
> label = gtk.Label('Choose a program to run as %s' %
> os.getenv('USERNAME'))
> 
> 
That's exactly what I have.
> 
> On my system (FreeBSD) there is a USER env variable,
> but no USERNAME
> Make sure you do su - and not just su
> Are you allowing other users to connect to your
> x-server (xhost +)
> Be very careful any time you run things as root
> (especially running
>   things automatically from a script)

su and not just su?Since this program was created
solely as a GUI (everything could be easily done from
the command line), I use gksu (GNOME's GUI to su)
instead, but when I tested it, su had the same
problem. I found that the HOME environment variable
did change with su/gksu, so I'll try to work something
out with that, but there should be a better way.

Daniel Ehrenberg

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/



More information about the Tutor mailing list