I am new to python.
I have a set of commands which I want to convert to a python script.
foreach f (`cat ../etc/l.list`)
cp ../r/"$f".txt .
I succeded in creating folders with respective names as listed in l.list,
but struggling to copy respective files "$f".txt to respective f folders
this is what i put down till now
import os, sys
fil = open("../etc/l.list")
lines = fil.readlines()
for f in lines:
dirname = "f"
if not os.path.isdir("./" + f + "/"):
os.mkdir("./" + f + "/")
can sobody tell me how to copy. tried copytree, but failed.