Python Forum

Full Version: Crate Loop into os file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all, I have this shell script that goes to a loop on file lines:

for dDames in `cat /tmp/Dnames`
do
#echo $dgname
    for FNames in `cat /tmp/FNames`
    do
       echo $DNames
       echo $FNames
done
done
How do I do same loop in python ?

File contets are like :
cat /tmp/Fnames
CELADM16
CELADM17
CELADM18

cat /tmp/Dnames
RECOC1
DBFSC1
DATAC1