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.
Baca Juga
- Pyqt5 Cannot Update Progress Bar From Thread And Received The Error "cannot Create Children For A Parent That Is In A Different Thread"
- Python Idle Compatible With Multithreading?
- Can't Run Idle With Pyenv Installation: `python May Not Be Configured For Tk` `modulenotfounderror: No Module Named _tkinter'
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"