Dear abhijangda,
Whenever Python interpreter encounters a Colon (

, it assumes that the following block of code will be indented by consistent white spaces (default 4 spaces). The line with colon and the block of code after colon cannot start from the first character. Please try this:
def op(path):
with open(path,'r') as f:
<tab>f.read()
Please use Notepad ++ and Geany in Windows or Geany in Linux as your editor.
Thanks