[PythonCE] Command line options and running without the shell
Richard Deeley
r_deeley at yahoo.com
Thu Feb 19 16:49:46 EST 2004
wrt mail posted below, maybe this addresses it:
'exec' and '-c' are common enough in UNIX/C world. Python has
a very different notion of these (for exec anyway, I have yet
to find any documentation on command line arguments). I suspect
the short answer to the issue raised in the prior mail below
(admittedly from a while back) is don't use '-c' on the command
line. What it does is very python specific and it DOESN'T run
scripts or programs.
Anyway, I ran into the same problem when I was trying to find a
way to run a python script WITHOUT the shell. Or at least, closing
it after the script completes. At the time '-c' seemed a reasonable
bet. I was wrong.
In looking through the pcceshell , there doesn't seem to
be an option to turn bInteract off. It starts off as 0, but as
soon as you get to run anything, it becomes a 1. You can set it
to a 1 using -i, but I don't see a way to unset it and run a
program. I can understand why it is done this way, but it wasn't
what I wanted.
OK, so I modified this and I now have a python script running
without leaving a shell window running. The next part is how to make
the output appear on the terminal I am using. So I nuked the bits that
set sys.stdout to the shell.
OK. That works. I got output from my program to go to the terminal
and the shell now closes immediately the program is done.
Now, did I just duplicate efforts already done and/or miss a
step somewhere ? (wouldn't be the first time, alas)
Or is there another way entirely of doing all this that doesn't
require tweaking pcceshell ? I am assuming that pcceshell is
embedded into the program that starts this stuff up. Although
I haven't actually looked into that.
As to revisions etc, Loaded the latest cab's from murk area as
of yesterday and its an IPAQ 2215.
btw: pythonce is a really cool product.
(Wonder if PIL will run there ?. May give it a try if I have
some time to port my other stuff)
http://mail.python.org/pipermail/pythonce/2002-August/000125.html
> Sorry I have taken so long to respond but I have done a number of installed
> and tried other things to get this to work. No luck yet. The following is
> an example of what I type in and the results:
>
> >>> My Documents\pyscripts\testpython.py
> Traceback (most recent call last):
> File "<string>:,line 1
> My Documents\pyscripts\testpython.py
> ^
> SyntaxError:invalid syntax
> >>>>
>
__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools
More information about the PythonCE
mailing list