hi,
I am new to python :).

I am having a file say "test.c"

test.c file contains
test1
test2
test3
test4

and my output should be write in a file as newtest.c...

-h test1 -e temp -x temp2 -o temp3
-h test2 -e temp -x temp2 -o temp3
-h test3 -e temp -x temp2 -o temp3
-h test4 -e temp -x temp2 -o temp3

how to write script in python :-/...

Recommended Answers

All 2 Replies

Start by reading the input file (and printing some or all of it's contents to make sure). Post the code used to read and print the file here and we will help you format the output file. Generally speaking, word questions yield word responses and questions with code yield code responses.

Start by reading the input file (and printing some or all of it's contents to make sure). Post the code used to read and print the file here and we will help you format the output file. Generally speaking, word questions yield word responses and questions with code yield code responses.

--------------
Thanks for quick response

i used to do it in shell script, but i am not sure how do it in python.

node file will be
test1
test2
test3
test4

Below is my shell script.. above file will be redirect to hpmpi..

i=0
for n in $node
do
node[$i]=$n
echo "-h ${node[$i]} -e hxt -f tes" >> hpmpi
i=`expr $i + 1`
done

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.