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''
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''
python get desktop directory
You can use os.environ["HOMEPATH"] to get the path. Right now it's literally trying to find %HOMEPATH%/Desktop without substituting the actual path.
Maybe something like:
shutil.copy(txtName, os.path.join(os.environ["HOMEPATH"], "Desktop"))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us