-1

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 :-/...

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by vineshn
0

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.

Edited by woooee: n/a

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.