Answers for "python get user pc name"

3

python get username windows

username = os.getlogin()
Posted by: Guest on April-27-2020
0

how to get pc name with python

# credit to the Stack Overflow user in the source link

import platform
platform.node()
>>>'DARK-TOWER'

# or equivalently

import socket
socket.gethostname()
>>> 'DARK-TOWER''
Posted by: Guest on June-04-2021

Python Answers by Framework

Browse Popular Code Answers by Language