In Python, the platform
module provides functions that access information of the underlying OS.
The platform.node()
method is used to return the computer’s node name. This method returns an empty string if it’s not able to determine the computer’s node name.
node()
This method takes no parameters.
It returns the computer’s node name.
import platformprint("platform.node() = %s" % (platform.node()))
platform
module.node()
method to retrieve the system’s network name on which the code is run.