How to specify a file path within the Python shell

There are a few things that I have noticed.

  1. After getting the nightly build to work I can now use the __file__ specifier in my program. I could not do that with the published 5.7.0 build. Here is a short program I am using to test this.
import os

dir = os.path.dirname(__file__)
print(dir)

If I place my script into the execution directory (which is not what I ultimately want) C:\Program Files\ParaView 5.7.0-963-g032f608266-Windows-Python3.7-msvc2015-64bit I get the following output.

Nightly Output

C:\Program Files\ParaView 5.7.0-963-g032f608266-Windows-Python3.7-msvc2015-64bit

v5.7.0 Output

Traceback (most recent call last):
  File "<console>", line 1, in <module>
NameError: name '__file__' is not defined
  1. In the nightly build it limits me to having my script in the execution path which isn’t what I want. If I drop my script into some arbitrary directory \my\home\directory I get the error message I posted above.
File "<string>", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in 
position 2-3: truncated \UXXXXXXXX escape