glob - Python: Open all files that do not match a pattern -


I am trying to open all those files in a directory that does not match a pattern. The directory will contain files such as x_0192910, y_18329123 and z_00000000; I want to open all the files which are not ending in '00000000', I am trying to use glob.glob (8) zero, but I can not find regex correctly I * ^ 0 {8, 8} and * [! 0] have tried things like, but I am not sure about constructing the right expression. In short, I just want something like glob.glob ('no * _00000000'). Can anyone help?

Have you thought about filtering the list that is glob Returns? Something like this: glob.glob ('*') for E

 : if e [-9:] == "_00000000": Continue # / Code>   

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -