Menu

#1 os.getlogin() not work to me

v1.0_(example)
open
nobody
5
2006-07-11
2006-07-11
Anonymous
No

os.getlogin() not work to me. I have linux 2.6 python
2.3.5 .
when i execute the program, the terminal show:

[begin code]
Traceback (most recent call last):
File "/usr/bin/pyagend", line 440, in ?
main()
File "/usr/bin/pyagend", line 406, in main
if len(sys.argv) == 1: menu(usrfile, tmpfile, lista)
File "/usr/bin/pyagend", line 348, in menu
print 'Logname:\t' + os.getlogin() + '\n'
OSError: [Errno 2] No such file or directory
[end code]

I fix it change the line :

Logname:\t' + os.getlogin() + \

to:

Logname:\t' + pwd.getpwuid(os.getuid())[0] + \

and import the pwd module first

i find this in :

http://docs.python.org/lib/os-procinfo.html

Sorry for my english, i try to contribute.

See you!

ciBAt-
sonajadiabolica[-@-]gmail[-.-]com

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.