prefix1 = 'beginning_of_a_bunch_of_feature_classes_'
prefix2 = 'beginning_of_a_bunch_of_other_feature_classes_'
if featClassName in (prefix1 + '*', prefix2 + '*',
'other_dataset'):
then do this chunk of code....
The statement evaluates properly for 'other_dataset', but I can't
figure out how to get a wildcard into there to properly evaluate the
other 2
I think the best way to accomplish this is to use a regular
expression. Regular expressions are a way of describing a text
pattern. They are super powerful, but with power comes PITA, in that
they take a while to figure out. A good starting place is the python
documentation:
http://docs.python.org/library/re.html
Another good place to get started with them is the python HOW-TO
http://www.python.org/doc/2.6/howto/regex.html
That said to get you started let me make sure I understand the
question.
You have some kind of prefix like:
prefix1 = 'startOfFile_'
prefix2 = 'anotherStartOfFile_'
and you want to be able to test a string to see if it starts with
either of these strings:
I think that is correct?
Instead of typing out in long detail the code into this window here, I
have put together a simple script that will hopefully explain how this
all works. The link is:
http://geopython.googlegroups.com/web/regularExpressionExample.py
Hope this helps, let me know if it doesn't or if I have answered the
wrong question!
Cheers
Kevin
> > other 2- Hide quoted text -
>
> - Show quoted text -