On Fri, 2 Feb 2006, [EMAIL PROTECTED] wrote:
> silly newbie mistake
>
> your code runs fine on my openbsd box. ( I didnt uncomment the return
> map(...) line
My apologies - i should have made it clearer in the comment that it was
hardwired to return example data!
> thanks for the awesome exampl
silly newbie mistake
your code runs fine on my openbsd box. ( I didnt uncomment the return
map(...) line
thanks for the awesome example!
--mike
--
http://mail.python.org/mailman/listinfo/python-list
Tom, the script you referenced me errored ... But I will see if I can
get it working.
--
http://mail.python.org/mailman/listinfo/python-list
thanks tom,
I am running OpenBSD, NetBSD as well as OS X (FreeBSD)
My first python script
#!/usr/local/bin/python
print "Content-type:text/html\n\n";
import os, string
getrup = os.popen('ruptime').read()
show = getrup.splitlines()
for line in show:
if line.find("up" or "down"):
On Thu, 2 Feb 2006, [EMAIL PROTECTED] wrote:
> Well, I did want to add some formatting for example
I getcha. This is really an HTML problem rather than a python problem,
isn't it? What you need to do is output a table.
FWIW, here's how i'd do it (assuming you've got HP-UX ruptime, since
that's
Well, I did want to add some formatting for example
STATUS = "up"
getrup = os.popen('ruptime').read()
show = getrup.splitlines()
gethost = show[0]
hostname = gethost.split()
print hostname[0]
getstatus = hostname[1]
if getstatus.find("STATUS"):
print STATUS
else:
print "HOST DOWN
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi all,
>
> I have a simple snippet I am trying to keep the format the same as
> plain text, though I want to embed it in html ...
>
> basically,
>
> print "Content-type:text/plain\n\n";
> getrup = os.popen('ruptime').read()
> print get
hi all,
I have a simple snippet I am trying to keep the format the same as
plain text, though I want to embed it in html ...
basically,
print "Content-type:text/plain\n\n";
getrup = os.popen('ruptime').read()
print getrup
is the same format as if I ran 'ruptime' from the command line.
If I use
On Tue, 15 Nov 2005 09:35:00 +, Simon Brunning wrote:
> On 14/11/05, john boy <[EMAIL PROTECTED]> wrote:
>> using the following program:
>>
>> prefixes = "JKLMNOPQ"
>> suffix = "ack"
>> for letter in prefixes:
>> print letter + suffix
>> if prefixes == "O" or "Q"
>
> Here you need:
>
On 14/11/05, john boy <[EMAIL PROTECTED]> wrote:
> using the following program:
>
> prefixes = "JKLMNOPQ"
> suffix = "ack"
> for letter in prefixes:
> print letter + suffix
> if prefixes == "O" or "Q"
Here you need:
if prefixes == "O" or prefixes == "Q"
>print letter + "u" + suf
Hello John,
>using the following program:
>
>
>
>prefixes = "JKLMNOPQ"
>
>suffix = "ack"
>
>for letter in prefixes:
>
>print letter + suffix
>
>if prefixes == "O" or "Q"
if (letter == "O") or (letter == "Q"):
>
> print letter + "u" + suffi
using the following program:
prefixes = "JKLMNOPQ"
suffix = "ack"
for letter in prefixes:
print letter + suffix
if prefixes == "O" or "Q"
print letter + "u" + suffix
For this program I am trying to combine the individual letters with the suffix to form names...but for O and Q I n
12 matches
Mail list logo