Calculator Language is what the problem is called and I am to code it in python. The coding part is done but I am having trouble while reading the input file.
So the input file looks like this :
A = B = 4
C = (D = 2)*_2
#
What i would like to do is to read each character, line by line ( each line is an expression and has to be calculated), characters as characters and integers as integers, since I push them into stacks. There are two stacks one for the characters and numbers and the other for the operators.
Anyway this is what I have done with the input so far :
#!/usr/bin/python
a = open("testinput1.txt","r+")
wordList = [line.strip() for line in a];
print wordList[1]
And what i get is :
C = (D = 2)*_2
Also the end of file is reached when the file reader hits #.
Any sort of help or suggestions are welcome.
wordList[1]
? – Blender Jun 7 '13 at 6:07