I was doing an exersize with the following task: Write a python program to call an external command in Python.
As I could not solve it by my own I looked up the solution:
from subprocess import call
call(["ls", "-l"])
But the solution threw an Error: FileNotFoundError: [WinError 2]
I also tried adding shell=True and for example leaving out the brackets like following:
subprocess.call('ls -l', shell=True)
In this case it tells me that the command "ls" could not be found.
I am working on windows 10,Python 3.8.2 32 bit
I am kind of lost and would be glad if someone could help.
Thank you!