How to Get the PC Name in Python
Code
You can obtain it with os.getlogin
.
>>> import os
>>> os.getlogin()
'rydbr'
Environment
- OS: Windows11
- Version: Python 3.11.5
You can obtain it with os.getlogin
.
>>> import os
>>> os.getlogin()
'rydbr'
🍂Autumn Special Omakase🍂
「Dual Numbers and Automatic Differentiation」