the.theorist wrote:
> I'll keep both those in mind for future programs.
> my current fix has been
>
> if not args:
> args = [ sys.stdin ]
> else:
> map( open, args )
>
> and then a modification to the main loop, as you proposed.
>
> I thought that one day I might run into a problem open
"the.theorist" wrote:
> I used this bit of code to detect wether i want stdinput or not.
>
> if len(args)==0:
> args = [ sys.stdin ]
>
> Now in my main loop I've written:
>
> for file in args:
> for line in open( file ):
> #do stuff
>
> The probelm occurs when I pass no arguments a
the.theorist wrote:
> Steven Bethard wrote:
>
>>the.theorist wrote:
>>
>>>I was writing a small script the other day with the following CLI
>>>prog [options] [file]*
>>>
>>>I've used getopt to parse out the possible options, so we'll ignore
>>>that part, and assume for the rest of the discussion t
Steven Bethard wrote:
> the.theorist wrote:
> > I was writing a small script the other day with the following CLI
> > prog [options] [file]*
> >
> > I've used getopt to parse out the possible options, so we'll ignore
> > that part, and assume for the rest of the discussion that args is a
> > list
the.theorist wrote:
> I was writing a small script the other day with the following CLI
> prog [options] [file]*
>
> I've used getopt to parse out the possible options, so we'll ignore
> that part, and assume for the rest of the discussion that args is a
> list of file names (if any provided).
>
I was writing a small script the other day with the following CLI
prog [options] [file]*
I've used getopt to parse out the possible options, so we'll ignore
that part, and assume for the rest of the discussion that args is a
list of file names (if any provided).
I used this bit of code to detect