I am running python program from terminal
python -i abc.py <test.txt
but after completion of the program it does not remain in python.
what I want:
Output:
4 21
>>>
What is happening--
Output:
4 21
>>> >>>
Downloads:~$
Usually if we give command
python -i abc.py
it goes into python interactive mode after running the program.
Program(abc.py);
line=[]
f=int(raw_input())
i=0
while(i<f):
m=raw_input()
line.append(m)
i+=1
for i in line:
ind=i.find('$')
temp=''
for j in i[ind+1:]:
t=ord(j)
if((t>=48)&(t<=57)):temp=temp+j
elif(t!=32): break
temp='$'+str(int(temp))
print(temp)
test.txt
1
I want to buy Car for $10000
Thanks