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

From: Mitchell <>
Date: Sat, 18 Jul 2015 09:40:16 -0400 (EDT)

Hi Jay,

On Sat, 18 Jul 2015, Jay Young wrote:

> I've found that if I edit line 202 of the "run.lua" file to this:
> python='/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -u "%f"'
> that I can run Python3 from Textadept. However, I'd like to be able to run either Python 2 or 3. My thought (even though it's rarely done) is to make python 3 file extensions ".py3" and then keep python 2 extensions as normal (".py"). Is there a way that Textadept could tell the difference then and run the file in the correct version of Python?

You can put something like this in your ~/.textadept/init.lua file: = function()
     -- [code to determine which python to use]
     if python3 then
       return '/path/to/python3'
       return '/path/to/python2'

Run commands may be functions, which are evaluated, and the returned
string is used as the actual shell command.


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Sat 18 Jul 2015 - 09:40:16 EDT

This archive was generated by hypermail 2.2.0 : Sun 19 Jul 2015 - 06:41:15 EDT