> On Behalf Of Bruno Desthuilliers
> >> for line in open("/etc/passwd"):
>
> NB : this idiom relies on the VM automatically closing files,
> which is not garanteed on each and every implementation
> (IIRC, jython won't do it). This is ok for Q&D throwaway
> scripts targeting CPython, but should
john s. a écrit :
> On Mar 24, 9:39 pm, "Ryan Ginstrom" <[EMAIL PROTECTED]> wrote:
>>> On Behalf Of john s.
>>> import os, sys, string, copy, getopt, linecache
>>> from traceback import format_exception
>>> #The file we read in...
>>> fileHandle = "/etc/passwd"
>>> srcFile = open(fileHandle,'r')
>>
En Tue, 25 Mar 2008 07:44:59 -0300, john s. <[EMAIL PROTECTED]>
escribió:
>> for line in open("/etc/passwd"):
>> user, _pwd = line.split(":")
>^- Ok this one here we are taking a string spliting it
> into to variables...
>user gets one (the first) and _pwd gets to
This code is SO *CUTE*! I wish there was a font with little hearts to
dot the 'i's with, then it would be PERFECT!
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 25, 6:34 am, Bryan Olson <[EMAIL PROTECTED]> wrote:
> john s. wrote:
> > #/usr/bin/enviro python
>
> > #Purpose - a dropped in useracct/pass file is on a new server to build
> > #a cluster... Alas there are no home directories.. Let me rip through
> > #the passfile, grab the correct field (
On Mar 24, 9:39 pm, "Ryan Ginstrom" <[EMAIL PROTECTED]> wrote:
> > On Behalf Of john s.
> > import os, sys, string, copy, getopt, linecache
> > from traceback import format_exception
>
> > #The file we read in...
> > fileHandle = "/etc/passwd"
> > srcFile = open(fileHandle,'r')
> > srcList = srcFil
john s. wrote:
> #/usr/bin/enviro python
>
> #Purpose - a dropped in useracct/pass file is on a new server to build
> a cluster... Alas there are no home #directories.. Let me rip through
> the passfile, grab the correct field (or build it) and use it to make
> the directory!
>
> import os, sys
> On Behalf Of john s.
> import os, sys, string, copy, getopt, linecache
> from traceback import format_exception
>
> #The file we read in...
> fileHandle = "/etc/passwd"
> srcFile = open(fileHandle,'r')
> srcList = srcFile.readlines()
>
> #yah, a for loop that "iterates" through the file of "lin
Hi Everyone,
I hope not to offend you with too many question.. I've been lurking a
long time. I'm not keen on keeping e-mails or data stored in the
public space so this is my first post to the group.
That being said, I'm keen on refining my skills, I hope that I can
prove that I've move on beyond