I've run your code the exact same way in IDLE on Windows 10 and got the same result.
>>> print(os.uname())
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
print(os.uname())
AttributeError: module 'os' has no attribute 'uname'
And as @Joran Beasley pointed out, this function is only available in certain operating systems.
From an online compiler:
posix.uname_result(sysname='Linux', nodename='Check', release='5.4.10-x86_64-linode132', version='#1 SMP PREEMPT Thu Jan 9 21:17:12 UTC 2020', machine='x86_64')
If you want to get current os, I recommend the platform
module.
>>> import platform
>>> platform.platform()
'Windows-10-10.0.18362-SP0'
Some people prefer using os
module, but platform
is much more readable.