This simple program in Python 3 throws errors. What could be the reason? This problem arose after I installed/reinstalled Python 3.5/3.6. Also
Python 3
Python 3.5/3.6
It seems that "dir" is not in your path. I do not know the full path of this executable on Windows but maybe you should replace dir by c:\windwos\system\dir
Or a best solution would be to use functions in the os modules to list directories:
os.listdir(path)