os.path.exists()
--
http://mail.pyth
ugly. i guess this thread shows that you are clueless regarding your
thread crapping.
--
http://mail.python.org/mailman/listinfo/python-list
> > if glob.glob(...): ...
>
> As for your possible solutions, if you consider any
> of yours to be "readable", then i have no interest in
> coding with you.
> > if glob.glob(...): ...
>
> I guess, for readability, nothing has come up that
> seems _great_.
> > if glob.glob(...): ...
>
> It works,
Hi Dan,
It works, it's elegant, and it uses python strengths.
I guess I have to settle the question of who my audience is. That is
who do I want to make it readable for.
All the solutions so far require some python specific knowledge, and
there are some which are horendous even at that. Perhaps
On 7 Oct 2005 16:17:22 -0700,
"mike" <[EMAIL PROTECTED]> wrote:
> Thanks Mike. Would there be an idiom using "is"?
> somethng like
> glob.glob('2005*) is not Empty
> I have not figured out what to put on the right hand
> side of "is"
Don't put anything there:
if glob.glob('2005*'):
Thanks Mike. Would there be an idiom using "is"?
somethng like
glob.glob('2005*) is not Empty
I have not figured out what to put on the right hand
side of "is"
I guess, for readability, nothing has come up that
seems _great_. One last effort would be to hide
the code behind a method, and u
"mike" <[EMAIL PROTECTED]> writes:
> Test for the existence of one or more matches of the wildcard
> expression.
>
> For example:
>
> Are there any files that begin with 2005?
>
> This doesn't work (wish it did):
> os.access('2005*',os.F_OK)
I would considering it suprising if it worked.
No need to apologize for continuing to waste your
time, self.plonk. Get a life, though, and you'll be happier.
As to your question, well, not before you apologize for
thread crapping.
As for your possible solutions, if you consider any
of yours to be "readable", then i have no interest in
coding
"mike" wrote:
> dude, you are the sap that wrote "it's not clear".
followed by three possible solutions to the stated problem, one
of which was marked as "most likely".
> get a life.
oh, sorry for wasting my time. can I *plonk* you now?
--
http://mail.python.org/mailman/listinfo/python-l
dude, you are the sap that wrote "it's not clear". get a life.
--
http://mail.python.org/mailman/listinfo/python-list
"mike" wrote:
> Test for the existence of one or more matches of the wildcard
> expression.
why are you reposting variations of your question (in duplicates)
instead of reading the replies? that's not a good way to pass the
turing test.
--
http://mail.python.org/mailman/listinfo/python-lis
Test for the existence of one or more matches of the wildcard
expression.
For example:
Are there any files that begin with 2005?
This doesn't work (wish it did):
os.access('2005*',os.F_OK)
However, these work arounds do the job:
glob.glob('2005*')==[]
as does this bash command:
Test for the existence of one or more matches of the wildcard
expression.
For example:
Are there any files that begin with 2005?
This doesn't work (wish it did):
os.access('2005*',os.F_OK)
However, these work arounds do the job:
glob.glob('2005*')==[]
as does this bash command:
Leif K-Brooks wrote:
>>os.access(path,mode)
>>
>> where path may contain linux style wildcards.
>
> os.access(glob.glob(path), mode)
Traceback (most recent call last):
File "", line 1, in ?
TypeError: access() argument 1 must be string, not list
it's not clear from the OP if he wants
thanks Leif. poor question on my part.
I had been using
glob.glob(path)==[]
and was looking for something more readable, hence
os.system('[ -e %s ]' % path )
but that doesn't seem like a good idiom for crossplatform.
I thought there may either be a way to escape the wildcards, or an
thanks Leif. poor question on my part.
I had been using
glob.glob(path)==[]
and was looking for something more readable, hence
os.system('[ -e %s ]' % path )
but that doesn't seem like a good idiom for crossplatform.
I thought there may either be a way to escape the wildcards, or an
mike wrote:
> i'd like to use
>
>os.access(path,mode)
>
> where path may contain linux style wildcards.
os.access(glob.glob(path), mode)
--
http://mail.python.org/mailman/listinfo/python-list
i'd like to use
os.access(path,mode)
where path may contain linux style wildcards.
i've failed so far.
my workaround is the bash command.
os.system('[ -e %s ]' % fn )
any suggestions?
--
http://mail.python.org/mailman/listinfo/python-list
18 matches
Mail list logo