[TxMt] Re: using python 3.0.1

Peter Cowan cowan.pd at gmail.com
Fri Mar 13 20:34:12 UTC 2009


On Fri, Mar 13, 2009 at 1:27 PM, Christian <maillists at gmx.de> wrote:
>
> Am 13.03.2009 um 21:12 schrieb Alex Ross:
>
>> On Mar 13, 2009, at 12:59 PM, Rob McBroom wrote:
>>
>>> On 2009-Mar-13, at 2:15 PM, Christian wrote:
>>>
>>>> But I would like to use Python v3 within TextMate when pressing cmd
>>>> +R.
>>>> Could that be done in some way? If yes, could you please a minimal
>>>> example how to code it?
>>>
>>>
>>> Try setting TM_PYTHON to "/path/to/python3.0". It can be set per-
>>> project or globally in TextMate's preferences. This will make ⌘R
>>> use
>>> Python 3, but it might also be enough to break some commands. I
>>> haven't tried it.
>>
>> Commands should use /usr/bin/env python — not TM_PYTHON — so this
>> should be ok.  You can also use a hash-bang at the start of your
>> script, and ⌘R will respect that.
>
> May I miss something here, but I used
>
> #!/usr/bin/env python
> print ("hallo world")
>
> and the output window of TM says (it's writter directly under the
> field where your can change the theme) that Python 2.5.1 is used. Is
> there no way to use 3.0.1?

Try:

#!/usr/bin/env python3.0
print ("hallo world")


I have both 2.5 and 2.6 installed on my system and both

#!/usr/bin/env python2.5
print ("hallo world")

#!/usr/bin/env python2.6
print ("hallo world")

work as desired

> Thanks
> Christian
>
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
>



More information about the textmate mailing list