|
|
import os
1 e) ]' E2 v& Z( R9 O2 H# Ppath = r"F:\Python\task"
[. `4 r p5 x3 F- W% F- Gotherpath=r"F:\Python\other"
' k3 w( b0 h% @: g" J8 bfor filename in os.listdir(path):
7 l1 L% M* C, O% z print(path,filename)$ M' n9 w+ j. J% D% H8 ?: |5 n
fullname=os.path.join(path,filename)& [: `) x, v3 E: V: m1 Y
if os.path.isfile(fullname): , T* w' J R, K: ^4 R
othername=os.path.join(otherpath,filename) # L: V1 U, V8 }, `0 a8 W( @: H; `: m
otherfile=open(othername,'wb')
+ h! C1 q5 m, ~- @8 L( w for line in open(fullname,'rb'):
8 A4 m- i( w7 N% z3 m: U2 X S for c in line:% O1 L/ H. ^$ f0 g. m7 P8 z
if not c.isdigit():otherfile.write(c)
. k4 `) `. s% _- a2 l otherfile.close() |
|