I am learning python file handling. I tried this code to read one character at a time
f = open('test.dat', 'r')
while (ch=f.read(1)):
print ch
Why it's not working
Here is Error message
C:\Python27\python.exe "C:/Users/X/PycharmProjects/Learning Python/01.py"
File "C:/Users/X/PycharmProjects/Learning Python/01.py", line 4
while (ch=f.read(1)):
^
SyntaxError: invalid syntax
Process finished with exit code 1