His lab maintains a significant amount of Perl code
this sounds like a full-time job on its own. everyone brings up a
good point... use the right tool for the job. if it's one-liners,
that's what perl -e is made for. for everything else that you
mentioned above, Python is the the one,
* Chris Lasher [EMAIL PROTECTED] [2006-10-15 22:07]:
Haha! I'll relay that message! Thanks Kent and Glenn!
Here is one I actually use in real life. I needed something to figure
out what the previous year, month, etc for rolling up old log files.
The best thing I could think of for date
David Rock [EMAIL PROTECTED] wrote in message
This is embedded inside a shell script.
python -c '
import time
import datetime
dtup_now = time.localtime()
y,m,d = dtup_now[:3]
d_today = datetime.datetime(y,m,d)
d_delta = datetime.timedelta(d_today.day)
last_month = d_today - d_delta
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of wesley chun
Sent: Monday, October 16, 2006 12:51 AM
To: Chris Lasher
Cc: Python Tutor
Subject: Re: [Tutor] Equivalent to perl -e
His lab maintains a significant amount of Perl code
* Alan Gauld [EMAIL PROTECTED] [2006-10-16 17:32]:
Why?
Why not just put it in a Python script?
I'm missing something I think.
I don't think you are missing anything. It was something that just sort
of happened one day. I was trying to do something fairly simple in a
shell script and
On 10/17/06, David Rock [EMAIL PROTECTED] wrote:
* Alan Gauld [EMAIL PROTECTED] [2006-10-16 17:32]: Why? Why not just put it in a Python script? I'm missing something I think.
I don't think you are missing anything.It was something that just sortof happened one day.I was trying to do something
My professor and advisor has been inspired by me to give Python a
try. He's an avid Perl user, and challenged me with the following:
What is the Python equivalent to perl -e 'some oneliner'?
Embarassingly, I had no answer, but I figure, someone on the list will
know. His use of Python is at
Chris Lasher wrote:
My professor and advisor has been inspired by me to give Python a
try. He's an avid Perl user, and challenged me with the following:
What is the Python equivalent to perl -e 'some oneliner'?
python -c
More details here:
http://linuxcommand.org/man_pages/python1.html
Chris Lasher wrote:
My professor and advisor has been inspired by me to give Python a
try. He's an avid Perl user, and challenged me with the following:
What is the Python equivalent to perl -e 'some oneliner'?
Embarassingly, I had no answer, but I figure, someone on the list will
know. His use
Haha! I'll relay that message! Thanks Kent and Glenn!
Chris
On 10/15/06, Glenn T Norton [EMAIL PROTECTED] wrote:
Chris Lasher wrote:
My professor and advisor has been inspired by me to give Python a
try. He's an avid Perl user, and challenged me with the following:
What is the Python
[Chris Lasher]
My professor and advisor has been inspired by me to give Python a
try. He's an avid Perl user, and challenged me with the following:
What is the Python equivalent to perl -e 'some oneliner'?
The initally attractive but unsatisfying answer is:
python -c 'some oneliner'
The
Points well taken. In fact, the example he demonstrated to me as a
one-liner was a regular expression as a line filter in
Emacs--essentially just a grep. There's no Pythonic equivalent to
this. Right tool for the right job, as you said. He was half-joking
about not learning Python if it lacked the
12 matches
Mail list logo