File size: 492 Bytes
f7e86c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os
import shutil
import glob

# ุงู„ููˆู„ุฏุฑ ุงู„ุฌุฏูŠุฏ
destination_folder = "diseases"
os.makedirs(destination_folder, exist_ok=True)  # ู„ูˆ ู…ุด ู…ูˆุฌูˆุฏุŒ ูŠู†ุดุฆู‡

# ุงู„ุจุญุซ ุนู† ูƒู„ ู…ู„ูุงุช .txt ููŠ ุงู„ููˆู„ุฏุฑ ุงู„ุญุงู„ูŠ
txt_files = glob.glob("*.txt")

# ู†ู‚ู„ ูƒู„ ู…ู„ู
for file in txt_files:
    shutil.move(file, os.path.join(destination_folder, os.path.basename(file)))

print(f"โœ… ุชู… ู†ู‚ู„ {len(txt_files)} ู…ู„ู ุฅู„ู‰ '{destination_folder}'")