combine python function with for loops in bash terminal
Question: I aimed to open multiple files (one by one, using for loop in bash terminal)
and modify it using PLINK (a programme) and later on, python function.
Following are the codes:

    
    
    for i in {1..10}; do
      plink --cow --noweb --lfile $i --extract extract1.snp --recode --out 1$i
      python -c 'import file_convert;file_convert.convert_tree_mix("1$i.map","tmp$i")'
    done
    

But, as expected, python could not read and could not open "11.map", it did
not replace "$i" with 1. How can i modify the code so that python function, in
combination with for loop, open different file each time based on the value of
"i"


Answer: Have you tried calling python like that:

    
    
    python -c 'import sys; import file_convert;file_convert.convert_tree_mix(sys.argv[1],sys.argv[2])' "1$i.map" "tmp$i";
    

?

