[Pythonmac-SIG] Re: I stand corrected on BBEdit Python Filters

Daniel Lord dmlsj@yahoo.com
Fri, 20 Dec 2002 07:37:47 -0800


Yes that seems to be the differentiator. Using "print repr(sys.argv)" 
shows a temp file is created, one per script, to pass the selection. 
BTW, BBEdit does appear to read the first line of the file to look for 
an executable (ie #!...). I tried Jython/Swing and Python/AquaTkinter 
scripts to put up windows with buttons including AWT and lambda-based 
event processing and they both work. Unfortunately BBEdit leaves up an 
annoying dialog while running the script, but UI-driven filters and 
scripts could add a new dimension in expandability to BBEdit. I am 
using BBEdit 7 and didn't keep 6.5 around so I don't know if this works 
in 6.5, though I suspect it does.

--Daniel


On Thursday, Dec 19, 2002, at 10:26 US/Pacific, Neil Mayhew wrote:

> on 19/12/2002 10:13 AM, Mark Day wrote:
>> BBEdit runs your filter with the input in a temporary file passed as 
>> an
>> argument (not standard input)... I think the Perl <> construct reads 
>> from the
>> filenames given as arguments, or standard input if there were no 
>> arguments.
>
> IOW, the version using the Python fileinput module worked because 
> fileinput
> does the same as the Perl construct, ie it uses sys.argv or sys.stdin 
> as
> appropriate.
>
> --Neil
>
>
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
>