I'm just starting Python (3.3) on Windows 7, and the book I've been using (Learning Python, by Mark Lutz) says I can also run Python modules by using the exec(...) function. This is the code the author presents:
>>> exec(open('script2.py').read())
The error this code shows is:
FileNotFoundError: [Errno 2] No such file or directory: 'script2.py'
To emphasise, I do have the PYTHONPATH variable set, and therefore the import function works properly: it doesn't show any error messages after importing a module.
I have provided the screenshot: https://i.sstatic.net/ZzDLE.png
To prove that the file imports normally, I will take a screenshot when importing that file: https://i.sstatic.net/gLiH4.png
Even though I don't believe there is something wrong with the Pathway, but with the function itself... Help!
script2.pyin the working directory?dir.