| | |
program to read print who you are, based on your user account in/etc/passwd.
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Mar 2006
Posts: 18
Reputation:
Solved Threads: 0
Python Syntax (Toggle Plain Text)
import posix import string uid = `posix.getuid()` passwd = open('/etc/passwd') for line in passwd.readlines(): rec = string.splitfields(line, ':') if rec[2] == uid: print 'hello', rec[0], print 'mind if we call you bruce?' break else: print "I can't find you in /etc/passwd" :)
Last edited by alc6379; Apr 22nd, 2006 at 9:13 pm.
Re: program to read print who you are, based on your user account in/etc/passwd.
0
#2 Apr 20th, 2006
Re: program to read print who you are, based on your user account in/etc/passwd.
0
#3 Apr 22nd, 2006
![]() |
Similar Threads
- User Account Control: Annoying, but Secure? (Windows Vista and Windows 7)
- Program does not read through correctly (C)
- user account does not work (Troubleshooting Dead Machines)
- print problem in restricted user account (Windows NT / 2000 / XP)
- Creation of an exclusive user account in Windows 2000 pro (Windows NT / 2000 / XP)
Other Threads in the Python Forum
| Thread Tools | Search this Thread |
alarm assignment avogadro beginner bluetooth character cmd code customdialog cx-freeze data decimals dictionary directory dynamic error examples excel exe file float font format function generator gnu graphics gui halp homework http ideas import input itunes java leftmouse line linux list lists logging loop maintain maze module mouse number numbers output parsing path port prime programming projects push py2exe pygame pyglet pyqt python queue random recursion schedule screensaverloopinactive script scrolledtext slicenotation sqlite ssh stdout string strings sudokusolver table terminal text thread threading time tkinter tlapse tuple tutorial ubuntu unicode urllib urllib2 variable ventrilo verify vigenere web webservice wikipedia windows wxpython xlib






