On Feb 11, 2013, at 2:13 PM, "Chip G." <[email protected]> wrote:

> On Feb 11, 2013, at 16:12, Maarten Sneep wrote:
> 
>> On 11 feb. 2013, at 21:25, "Chip G." <[email protected]> wrote:
>> 
>>> I'm trying to learn Python. I have a book that is helping me along. I'd 
>>> like to use BBEdit as my editor, but I'm having some issues. Part of this 
>>> is an Apple/Fink thing. Part of the problem is that the version of python 
>>> get if I run using 'python' is old (v2.7.1). If I force paths I can get 
>>> v2.7.3 or v3.2.3. As near as I can tell, BBEdit uses the version as if I 
>>> typed 'python' which doesn't work properly with the code in the book. Even 
>>> if I download the authors copy directly. So I'm trying to find a way to 
>>> force BBEdit to use a specific version 2.7.3 or 3.2.3 vice the 2.7.1 it 
>>> keeps preferring. Any ideas?
>> 
>> What's the first line of your script?
> 
> It starts with a line with a '#' and the name of the file. Next after that is:
> 
> from tkinter import *
> 
> Which works under python 3.2 but not in python 2.7 unless I make it Tkinter.
> 
> If I do
> $python myscript.py
> It uses 2.7.1.
> 
> If I do
> $python2.7 myscript.py
> It uses 2.7.3.
> 
> If I do
> $python3.2 myscript.py
> It uses 3.2.3.
> 
> If I run it from BBEdit it runs behaves the same as the first example. My 
> script, which is calling for Tk to draw a very basic window, doesn't work 
> under 2.7.1 but does under 2.7.3 and 3.2.3. I can test this from the command 
> line perfectly. What I need is a way to control what BBEdit is using.
> 
>> If python 2.7.1 rejects the code, then I assume that the code is written for 
>> python 3 (which is a sensible version to learn these days).
> 
> Nope, works under 2.7.3. And if your statement is true it still doesn't 
> explain how to force BBEdit to use 3.
> 
>> You can try to set the first line to:
>> 
>> #!/usr/bin/env python3
> 
> That looks like bash script, will that work at the beginning of a python 
> script?
> 
> Tried it and BBEdit gave me this error:
> "env: python3: No such file or directory"
> 
>> If that doesn't work, try to be more specific (open a terminal, and see 
>> which versions of python are available, typing python and pressing the 
>> tab-key should provide some options).
> 
> See above.
> 
>> As a last resort, you could use the full path to python:
>> 
>> #!/usr/local/bin/python3
> 
> No, still getting the same errors (tried forcing 2.7.3 too, no dice).
> 
>> I'm sure others will provide the correct method for getting BBEdit to 
>> recognize your scripts and finding the appropriate interpreter.
> 
> I hope so ... :)
> 
> 
> --
>    Chip
> 

try this in terminal:

which python3

then use the resulting path as above.


-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to