Re: Is Python as capable as Perl for sysadmin work?

2005-02-10 Thread Nick Coghlan
Richie Hindle wrote:
[Steve]
Was it INTERCAL that had the COMEFROM  statement instead of
GOTO? I REALLY like the idea of a COMEFROM statement. I think python should
have a COMEFROM statement

It does - see http://entrian.com/goto/
(In case you doubt it: yes, it works, but note that it doesn't work at the
interactive prompt, only in a real source file.)
(The fact that I felt obliged to add the first paragraph on that page is
the funniest part of the whole thing.  I really did have people genuinely
thanking me for the module, asking for features, asking for help with
using it, and so on.)
That module is. . .
 a) impressive
 b) very, very, wrong
 c) both a) and b)
I think I'm voting for c). . .
Cheers,
Nick.
--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-10 Thread Richie Hindle

[Steve]
> Was it INTERCAL that had the COMEFROM  statement instead of
> GOTO? I REALLY like the idea of a COMEFROM statement. I think python should
> have a COMEFROM statement

It does - see http://entrian.com/goto/

(In case you doubt it: yes, it works, but note that it doesn't work at the
interactive prompt, only in a real source file.)

(The fact that I felt obliged to add the first paragraph on that page is
the funniest part of the whole thing.  I really did have people genuinely
thanking me for the module, asking for features, asking for help with
using it, and so on.)

-- 
Richie Hindle
[EMAIL PROTECTED]

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-09 Thread Jeff Shannon
Courageous wrote:
*checks self to see if self is wearing rose colored glasses*
assert(self.glasses.color != 'rose')
;)
Jeff Shannon
Technician/Programmer
Credit International
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-09 Thread Courageous

>>  Well, that's where Python helps you out compared to
>> Perl.  Python can be a bit clumsier than Perl for dirt-simple tasks, but
>> you'll find that Python scales much better than Perl.

My opinion:

If "scales" refers to the /manageability/ of the code produced,
I'd say that Python scales better than C++. I would /much/ rather
manage a million lines of Python than a million lines of C++.

*checks self to see if self is wearing rose colored glasses*

*doesn't think so*

C//

-- 
http://mail.python.org/mailman/listinfo/python-list


Python as a machine tool (Re: Is Python as capable as Perl for sysadmin work?)

2005-02-09 Thread Greg Ewing
Jeff Epler wrote:
Unlike Perl, Python implements only a *finite turning machine*
That's interesting -- I didn't know Python could be
used as a lathe. You learn something new every day!
I suppose an "infinite turning machine" would
be a really *big* lathe...
--
Greg Ewing, Computer Science Dept,
University of Canterbury,   
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-09 Thread Steve Horsley
Jeff Epler wrote:
  If I want to beg my computer to run programs, I know
where to find Intercal with its "PLEASE" and "DO PLEASE" constructions.
Was it INTERCAL that had the COMEFROM  statement instead of
GOTO? I REALLY like the idea of a COMEFROM statement. I think python should
have a COMEFROM statement, but since perl revels in being impenetrable, I
suppose perl is likely to get it first. Shame.
Steve
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-09 Thread Caleb Hattingh
Roy
How about the Yoda version:
do:
   statement
do not do:
   statement
The Yoda version actually goes
  statement
:do
  statement
:not do
Caleb
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-09 Thread Roy Smith
In article <[EMAIL PROTECTED]>,
 Max M <[EMAIL PROTECTED]> wrote:

> Jeff Epler wrote:
> > No.
> > 
> > Unlike Perl, Python implements only a *finite turning machine* model of
> > computation.  An easy way to see this limitation is in the following
> > code:
> > >>> 1.0 / 10.0
> > 0.10001
> > In an infinite Turning machine, there would be an unbounded number of
> > zeros before the second 1, giving the exact result, not a numeric
> > approximation.
> 
> Another thing is that in Perl it turns left, while in Python it turns 
> right. hence the .rfind() string method.
> 
> 
> > Well, if you ever
> > have to threaten Python, just keep in mind that '... or die' just plain
> > won't work.  You have to suggest that it 'try ... except', which is
> > really offensive.  If I want to beg my computer to run programs, I know
> > where to find Intercal with its "PLEASE" and "DO PLEASE" constructions.
> 
> Wasn't there talk about a "try harder" recently?
> 
> try:
>  statement
> tryharder:
>  statement

How about the Yoda version:

do:
   statement
do not do:
   statement
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-09 Thread Nick Craig-Wood
Jeff Epler <[EMAIL PROTECTED]> wrote:
>  Finally, Python just doesn't respond to threats as well as Perl does.
>  I have run into many Perl programs that just didn't quite work right
>  until I wrote '... or die "$!"' in the right places.

I find

  '... or die "You [EMAIL PROTECTED]"'

works even better ;-)

Thanks for a very amusing post!
-- 
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-08 Thread Max M
Jeff Epler wrote:
No.
Unlike Perl, Python implements only a *finite turning machine* model of
computation.  An easy way to see this limitation is in the following
code:
>>> 1.0 / 10.0
0.10001
In an infinite Turning machine, there would be an unbounded number of
zeros before the second 1, giving the exact result, not a numeric
approximation.
Another thing is that in Perl it turns left, while in Python it turns 
right. hence the .rfind() string method.


Well, if you ever
have to threaten Python, just keep in mind that '... or die' just plain
won't work.  You have to suggest that it 'try ... except', which is
really offensive.  If I want to beg my computer to run programs, I know
where to find Intercal with its "PLEASE" and "DO PLEASE" constructions.
Wasn't there talk about a "try harder" recently?
try:
statement
tryharder:
statement
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-08 Thread Peter Maas
Jeff Epler schrieb:
Unlike Perl, Python implements only a *finite turning machine* model of
computation.  An easy way to see this limitation is in the following
code:
>>> 1.0 / 10.0
0.10001
In an infinite Turning machine, there would be an unbounded number of
zeros before the second 1, giving the exact result, not a numeric
approximation.
Boy, you are cheating us Wake up, this isn't April 1st! :)))
--
---
Peter Maas,  M+R Infosysteme,  D-52070 Aachen,  Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
---
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-08 Thread Peter Maas
Jeff Epler schrieb:
There's another little-known fact about Python:  No string is permitted
to end with a backslash! 
Sure you meant string literals. But that is wrong, too:
>>> a = '\\'
>>> print a
\
A Python string mustn't end with an *odd* number of backslashes. Other-
wise a literal using backslash escapes like 'don\'t do that' couldn't
be parsed.
Now, this may not bother Unix sysadmins, but the honest truth is that
you'll be administrating Windows systems, too, anywhere you work!
This is no problem, thanks to os.path.join() ;)
Well, if you ever
have to threaten Python, just keep in mind that '... or die' just plain
won't work.  You have to suggest that it 'try ... except', which is
really offensive.  If I want to beg my computer to run programs, I know
where to find Intercal with its "PLEASE" and "DO PLEASE" constructions.
Sysadmin work with Intercal? Go ahead! ;) But what's wrong with a
protecting try .. except block vs. "... or die" for every command
to be protected?
--
---
Peter Maas,  M+R Infosysteme,  D-52070 Aachen,  Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
---
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-08 Thread Paddy McCarthy
Jeff Epler wrote:
No.
Unlike Perl, Python implements only a *finite turning machine* model of
computation.  An easy way to see this limitation is in the following
code:
>>> 1.0 / 10.0
0.10001
<>
Jeff
Nice,
Made my evening :-)
- Pad.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-08 Thread Jeremy Bowers
On Tue, 08 Feb 2005 18:18:13 +, Marc Huffnagle wrote:

> Jeff Epler wrote:
>> 
>> There's another little-known fact about Python:  No string is permitted
>> to end with a backslash!  You might think that variations like
>> r'\'
>> or
>> ""\""
>> would allow you to create this elusive value, but you'd mistaken!
>> Now, this may not bother Unix sysadmins, but the honest truth is that
>> you'll be administrating Windows systems, too, anywhere you work!
> 
>  >>> a = "\\"
>  >>> print a
> \

That's really the only problem you had with his post?

:-O

*wink*


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-08 Thread Marc Huffnagle
Jeff Epler wrote:
There's another little-known fact about Python:  No string is permitted
to end with a backslash!  You might think that variations like
r'\'
or
""\""
would allow you to create this elusive value, but you'd mistaken!
Now, this may not bother Unix sysadmins, but the honest truth is that
you'll be administrating Windows systems, too, anywhere you work!
>>> a = "\\"
>>> print a
\
Marc
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-08 Thread Jeff Epler
No.

Unlike Perl, Python implements only a *finite turning machine* model of
computation.  An easy way to see this limitation is in the following
code:
>>> 1.0 / 10.0
0.10001
In an infinite Turning machine, there would be an unbounded number of
zeros before the second 1, giving the exact result, not a numeric
approximation.

There's another little-known fact about Python:  No string is permitted
to end with a backslash!  You might think that variations like
r'\'
or
""\""
would allow you to create this elusive value, but you'd mistaken!
Now, this may not bother Unix sysadmins, but the honest truth is that
you'll be administrating Windows systems, too, anywhere you work!

Finally, Python just doesn't respond to threats as well as Perl does.
I have run into many Perl programs that just didn't quite work right
until I wrote '... or die "$!"' in the right places.  Well, if you ever
have to threaten Python, just keep in mind that '... or die' just plain
won't work.  You have to suggest that it 'try ... except', which is
really offensive.  If I want to beg my computer to run programs, I know
where to find Intercal with its "PLEASE" and "DO PLEASE" constructions.

Jeff


pgpmDM5lPWYOK.pgp
Description: PGP signature
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Is Python as capable as Perl for sysadmin work?

2005-02-08 Thread John M. Gabriele
Nick Vargish wrote:
"John M. Gabriele" <[EMAIL PROTECTED]> writes:

At some point during some dingy job in the back boiler room
of Unix, would you find yourself saying, "geez, I'd wish I
started this with Perl -- Python just isn't cutting it." ?

Sometimes I have to write a quick script in Perl because Python isn't
ubiquitous enough around here, and I often find myself thinking I
the opposite... "Perl just isn't cutting it."
And I spent several years putting food on the table with Perl, so it's
not like I'm a noob with Perl.
Nick
Thanks Nick (and everyone else) for the replies. Much appreciated.
--
--- remove zees if replying via email ---
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-08 Thread John M. Gabriele
Aahz wrote:
[snip]
Anyway.  Have you ever noticed how shell scripts keep getting longer?
Yup.
Ever notice how it gets harder to figure out what the heck any given
script's doing?
Yup.
 Well, that's where Python helps you out compared to
Perl.  Python can be a bit clumsier than Perl for dirt-simple tasks, but
you'll find that Python scales much better than Perl.
Check. Thanks Aahz. :)
--
-- remove zees if contacting via email --
--
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-08 Thread Nick Vargish
"John M. Gabriele" <[EMAIL PROTECTED]> writes:

> At some point during some dingy job in the back boiler room
> of Unix, would you find yourself saying, "geez, I'd wish I
> started this with Perl -- Python just isn't cutting it." ?

Sometimes I have to write a quick script in Perl because Python isn't
ubiquitous enough around here, and I often find myself thinking I
the opposite... "Perl just isn't cutting it."

And I spent several years putting food on the table with Perl, so it's
not like I'm a noob with Perl.

Nick

-- 
#  sigmask  ||  0.2  ||  20030107  ||  public domain  ||  feed this to a python
print reduce(lambda x,y:x+chr(ord(y)-1),' Ojdl!Wbshjti!=obwAcboefstobudi/psh?')
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-08 Thread Roy Smith
In article <[EMAIL PROTECTED]>,
 "John M. Gabriele" <[EMAIL PROTECTED]> wrote:

> I recently posted this sort of question to the c.l.p.m but
> didn't get much of a response. I know a little Perl and a
> little Python, but master neither at the moment.
> 
> I see that Python is a general purpose OO programming language
> that finds use among some system administrators, but my guess
> is that Perl is still more common in that area than Python.
> 
> For sysadmin-related tasks, is Python as useful as Perl, or
> does it get clumsy when often dealing with the stuff admins
> deal with on a regular basis?
> 
> At some point during some dingy job in the back boiler room
> of Unix, would you find yourself saying, "geez, I'd wish I
> started this with Perl -- Python just isn't cutting it." ?
> 
> Thanks,
> ---J

Given that Perl was *designed* for sysadmin work, it's not surprising that 
there are some features of it which make it very convenient to use in that 
arena.  For executing external commands, nothing really comes close to 
Perl's back-tick syntax.  For doing things like reading a sequence a files 
and filtering the combined contents with regular expressions, Perl is 
probably the tool that lets you do that in the most compact way.

As a general-purpose programming language, it sucks.  My personal opinion 
is that the general-purpose suckitude outweighs the domain-specific 
sysadmin convenience.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-07 Thread Aahz
In article <[EMAIL PROTECTED]>,
John M. Gabriele <[EMAIL PROTECTED]> wrote:
>
>For sysadmin-related tasks, is Python as useful as Perl, or does it get
>clumsy when often dealing with the stuff admins deal with on a regular
>basis?
>
>At some point during some dingy job in the back boiler room of Unix,
>would you find yourself saying, "geez, I'd wish I started this with
>Perl -- Python just isn't cutting it." ?

Not likely.  I'm a programmer, not a sysadmin, but my company's too
small for a sysadmin, so I and the other two programmers get elected.
(For example, today most of my time was spent hunting down kernel
patches for Red Hat 7.3 -- long story.)

Anyway.  Have you ever noticed how shell scripts keep getting longer?
Ever notice how it gets harder to figure out what the heck any given
script's doing?  Well, that's where Python helps you out compared to
Perl.  Python can be a bit clumsier than Perl for dirt-simple tasks, but
you'll find that Python scales much better than Perl.
-- 
Aahz ([EMAIL PROTECTED])   <*> http://www.pythoncraft.com/

"The joy of coding Python should be in seeing short, concise, readable
classes that express a lot of action in a small amount of clear code -- 
not in reams of trivial code that bores the reader to death."  --GvR
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-07 Thread John M. Gabriele
On Mon, 07 Feb 2005 20:13:30 -0800, beliavsky wrote:

> 
> [snip]
> 
> I'm a Windows user, not a Unix sysadmin, but I've noticed that
> Cameron Laird has written several articles on Python for system
> administration in Unix Review and Sys Admin magazine, for example
> http://www.unixreview.com/documents/s=9083/sam0401d/ . Reading his
> articles may help you decide if Python is a good fit for your work.

Great series of articles. Thanks for the link. :)

-- 
--- if replying via email, remove zees ---


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python as capable as Perl for sysadmin work?

2005-02-07 Thread beliavsky

John M. Gabriele wrote:
> I recently posted this sort of question to the c.l.p.m but
> didn't get much of a response. I know a little Perl and a
> little Python, but master neither at the moment.
>
> I see that Python is a general purpose OO programming language
> that finds use among some system administrators, but my guess
> is that Perl is still more common in that area than Python.
>
> For sysadmin-related tasks, is Python as useful as Perl, or
> does it get clumsy when often dealing with the stuff admins
> deal with on a regular basis?

I'm a Windows user, not a Unix sysadmin, but I've noticed that
Cameron Laird has written several articles on Python for system
administration in Unix Review and Sys Admin magazine, for example
http://www.unixreview.com/documents/s=9083/sam0401d/ . Reading his
articles may help you decide if Python is a good fit for your work.

-- 
http://mail.python.org/mailman/listinfo/python-list


Is Python as capable as Perl for sysadmin work?

2005-02-07 Thread John M. Gabriele
I recently posted this sort of question to the c.l.p.m but
didn't get much of a response. I know a little Perl and a
little Python, but master neither at the moment.

I see that Python is a general purpose OO programming language
that finds use among some system administrators, but my guess
is that Perl is still more common in that area than Python.

For sysadmin-related tasks, is Python as useful as Perl, or
does it get clumsy when often dealing with the stuff admins
deal with on a regular basis?

At some point during some dingy job in the back boiler room
of Unix, would you find yourself saying, "geez, I'd wish I
started this with Perl -- Python just isn't cutting it." ?

Thanks,
---J

-- 
--- if replying via email, remove zees ---


-- 
http://mail.python.org/mailman/listinfo/python-list