You pass the folder name wrapped in quotes:
test.py "D:\test\File Name"
sys.argv[1]
will contain the folder path, spaces included.
If for some reason you cannot quote the folder name, you will need to use the ctypes
module and use the Win32 API's GetCommandLine
function. Here's a functional example.