Getting name of windows computer running python script?

前端 未结 7 1601
耶瑟儿~
耶瑟儿~ 2021-01-30 01:15

I have a couple Windows computers on my network that will be running a python script. A different set of configuration options should be used in the script depending on which c

相关标签:
7条回答
  • 2021-01-30 02:05

    From https://mail.python.org/pipermail/python-list/2006-April/397494.html

    import os
    os.getenv('COMPUTERNAME')
    
    0 讨论(0)
提交回复
热议问题