Python code not running on Atom but on terminal

Hello, I am really new to programming and currently am learning Python through Coursera.
The course I am taking suggests using both Atom and terminal.

When I try to open a text file using the code below through terminal, the code just works fine.
However on Atom (I use script and Hydrogen package) the same code shows a traceback, saying ‘No such file or directory’ although the text file is saved under the same location as my .py file.

Could anyone help me understand what is happening? I want to see the code running in Atom too.