Python 获取 Windows 设备名称脚本
以下是一个 Python 脚本,可以获取 Windows 操作系统中的设备名称:
import win32api
computer_name = win32api.GetComputerName()
print('设备名称:', computer_name)
此脚本使用了 Python 的 win32api 模块,它提供了访问 Windows 操作系统 API 的接口。win32api.GetComputerName() 函数可以获取当前计算机的名称。
原文地址: https://www.cveoy.top/t/topic/nLry 著作权归作者所有。请勿转载和采集!