[Tutor] command line syntax
Remco Gerlich
scarblac@pino.selwerd.nl
Thu, 26 Apr 2001 23:31:36 +0200
On 0, Dinakar Desai <Desai.Dinakar@mayo.edu> wrote:
> I was wondering is there any way one can write command line script like
> that done in perl or shell.
> I tried FAQ and could not find what I was looking for.
>
>
> I look forward to hear from you.
I'm not sure what you mean. Is the -c option what you're looking for?
bash$ python -c 'print "whee"'
whee
bash$ python -c '
> from time import *
> print ctime()
> '
Thu Apr 26 23:29:58 2001
If you want a script that you can start from the command line, just put
in the appropriate #! line (#!/usr/bin/env python) just like you would with
sh, perl, tcl, expect or whatever...
--
Remco Gerlich