Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

find_dir

import re
from pathlib import Path
 
my_dir = r'G:div_codefoo_folder'
pattern = re.compile(r'^[A-Z0-9]{8}_d{4}$')
for ed in Path(my_dir).iterdir():
    if ed.is_dir():
        #print(ed)
        # <stem> path component,without it's suffix
        if re.search(pattern, ed.stem):
            print(ed)
            print(ed.stem)
            print('-' * 30)
Comment

PREVIOUS NEXT
Code Example
Python :: python change font in 1 line 
Python :: Simple Kivy pong game 
Python :: python string: string concatenation 
Python :: Print only small Latin letters a found in the given string. 
Python :: multiprocessing write to dict 
Python :: codegrepper is cool 
Python :: why is python so populair 
Python :: sum of multiples of 5 from 1 to 100 
Python :: pandas get indices of mask 
Python :: airflow set ui color of operator ui_color 
Python :: same line print python 
Python :: explained_variance_ratio kernel pca 
Python :: pandascheck if two columns match and populate new column 
Python :: swap two elements in list python 
Python :: index operator with if and elif statement in python 
Python :: math is python 
Python :: lib.stride_tricks.sliding_window_view(x, window_shape, axis=None, *, subok=False, writeable=False) 
Python :: python monats liste 
Python :: python exception vs error 
Python :: auto clipping path when upload image using python 
Python :: Create an identical list from the first list using list comprehension. 
Python :: libraries used in ANN with Keras Sequential Model 
Python :: python return true for list comprehension 
Python :: convert month weeks days into month days in python pandas 
Python :: python3 netifaces get current interface 
Python :: Increase "bar width" "px.bar" 
Python :: flask google analytics 
Python :: ya mom 
Python :: create a fibonacci function using a generator python 
Python :: Modifiying line plots 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =