[Tutor] os module question
Cameron Simpson
cs at zip.com.au
Mon Feb 2 22:38:15 CET 2015
On 02Feb2015 17:01, alan.gauld at btinternet.com <alan.gauld at btinternet.com> wrote:
>On 02/02/15 13:46, maurice.horan at thomsonreuters.com wrote:
>>Basically I have trouble with two things:
>>1) Get the server to take the hostname and use it to run a command against it
>
>os.uname() will return a tuple.
>The second item is the hostname
That gets this machine's hostname. The OP wants to use an arbitrary machine's
hostname, since he's looking up an asset db. He needs to use the sys.argv
array. (We he's doing as it turns out, so not to worry.)
Cheers,
Cameron Simpson <cs at zip.com.au>
I must really get a thinner pencil. I can't manage this one a bit. It writes
all manner of things I don't intend.
- rheney at csugrad.cs.vt.edu (Bolo Mk XXXIX)
More information about the Tutor
mailing list