Can i use this script as a python evaluator?

Peter Wang peterwang at vip.qq.com
Mon Oct 20 21:15:44 EDT 2008


Bruno Desthuilliers <bdesth.quelquechose at free.quelquepart.fr> writes:

> Peter Wang a écrit :
>> <code>
>> #! /bin/sh
>> python -c "import sys;exec(sys.stdin)"
>> </code>
>>
>> Emacs has a function `shell-command-on-region', which takes region as
>> input for the evaluator (script above), and output its result. I have
>> tried and found it works, is there any problems for this, or any other
>> better solution for it? Thanks.
>>
> If your problem is to eval a region of a python buffer and output the
> result to another buffer, then python-mode.el (the one that comes with
> Python, not the python.el bundled with recent emacs versions) already
> know how to do so.
Yes, I want eval a region, but likely not a python buffer, for example, 
in a *w3m* buffer.
>
> Else please explain what you're trying to do ?
> --
> http://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list