import socketimport getpassuser_name = getpass.getuser() # 获取当前用户名hostname = socket.gethostname() # 获取当前主机名print(type(user_name))print('C:\Users\' + user_name + '\AppDataLocalTemp\')print(hostname)print(user_name)