Mac Os - Os.system(command) Display Nothing
When I run IDLE (python 3.8) : >>> import os >>> os.system('ls') 0 >>> os.system('echo 'test'') 0 >>> os.system('users') 0 >>> But if
Solution 1:
I get the same issue and this is what I did:
- Restart the IDLE.
- Restart my laptop.
However, the same problem persists.
My suggestion is, instead of using IDLE, why don't you use the terminal? In my case, I use iTerm.
$ python3.8$ >>> import os
$ >>> os.system("ls")
And everything works fine.
Solution 2:
If you start IDLE from Terminal with `$ python3 -m idlelib' them output from os.system will appear in Terminal while the return value is printed in the IDLE Shell. But I unless I were developing a Python script that uses os.system, I would just keep IDLE and Terminal both open and type the appropriate commands in each.
Post a Comment for "Mac Os - Os.system(command) Display Nothing"