I have installed PyCharm to using Python language on Windows 10.
I'm trying to execute command from Linux command in PyCharm, I used this code:
import subprocess
subprocess.run("cat",shell=True,text=True)
But I get this error:
'cat' is not recognized as an internal or external command, operable program or batch file.
I want to execute several commands another such as this example, but all commands raise the same error. How to solve this?
catisn't a windows/DOS program. In other words, if you typecatinto the CMD prompt directly, you'll get the same result. In that sense, your python script is working as desired.