Revision 6 as of 2008-11-15 14:01:26

Clear message

Description

This is a simple Powerful Python One-Liners. It prints the systems's hostname to the screen.

Code

from socket import gethostname; print gethostname()

Download

This program has been uploaded to the Wiki. You can download it as an attachment from this page.

Well, sometimes. A lighter-weight variant with desirable properties is

import os; print os.uname()[1]

lwickjr: --which doesn`t seem to work on Windows. :(

Unable to edit the page? See the FrontPage for instructions.