| | |
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
Views: 1078 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Python
address ansi backend beginner changecolor class code conversion coordinates copy curves customdialog dan08 dictionary digital directory dynamic edit events examples excel feet file float font format ftp function generator getvalue gui halp homework i/o iframe images import info input ip java line linux list lists loop mouse mysql newb number numbers output panel parsing path port prime print program programming projects py2exe pygame pyqt python queue random rational recursion recursive screensaverloopinactive scrolledtext server ssh stamp statictext string strings sudokusolver table terminal text thread threading time tkinter tlapse tuple tutorial type ubuntu unicode url urllib urllib2 variable whileloop windows write wxpython






