RE: [code] [textadept] Run both Python 2 and 3

From: Mitchell <>
Date: Mon, 20 Jul 2015 10:16:20 -0400 (EDT)

Hi Jay,

On Sun, 19 Jul 2015, Jay Young wrote:

> Hi Robert and Mitchell,
> I really appreciate your replies, and like all these options you both have shared! I'd like to try adding Mitchell's code in the init.lua file, but admit I don't know much Lua. I'm not sure how to read the first line out of Textadept's active window (buffer?), but assuming this might be heading in the right direction?
> = function() line1 = <getting line 1 from active window?> if string.find(line1, 'python3') then return '/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4' else return '/System/Library/Frameworks/Python.framework/Versions/Current/bin/python' end end
> Thank you both again for your incredible help!

Something like this should work: = function()
     if buffer:get_line(0):find('python3') then
       return '/path/to/python3'
       return '/path/to/python2'


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Mon 20 Jul 2015 - 10:16:20 EDT

This archive was generated by hypermail 2.2.0 : Tue 21 Jul 2015 - 06:34:44 EDT