Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #94923

Re: I'm a newbie and I'm still stumped...

From Jussi Piitulainen <jpiitula@ling.helsinki.fi>
Newsgroups comp.lang.python
Subject Re: I'm a newbie and I'm still stumped...
Date 2015-08-03 12:49 +0300
Organization A noiseless patient Spider
Message-ID <lf538008zxh.fsf@ling.helsinki.fi> (permalink)
References (1 earlier) <mpis6l$b9f$1@ger.gmane.org> <mailman.1171.1438585158.3674.python-list@python.org> <ts8uradnhvig3rt9f3h3rs4prppqhflvo4@4ax.com> <D1E54D04.10C047%Dwight@GoldWinde.com> <mailman.1172.1438594259.3674.python-list@python.org>

Show all headers | View raw


Dwight GoldWinde quotes himself:
>
>> Okay, thank you, Dave, so I got the following info: type $(which
>> python3)
>> /Library/Frameworks/Python.framework/Versions/3.4/bin/python3 is
>> /Library/Frameworks/Python.framework/Versions/3.4/bin/python3
>>
>> But I can¹t figure out what short of ³usr² statement
>> (e.g. #!/usr/bin/env python3) I need to point it there. Whatever I
>> tried, still gives me version 2.

How are you launching your script? If your method involves clicking some
pretty picture or something similar, you may be bypassing /usr/bin/env
altogether and relying on some association of file types in Mac OS. Then
you need to investigate file properties in Finder, or something like
that. It should be safe to change the association for that individual
script but not necessarily for all files with the same extension.

If your method is to type "python scriptname" at the shell prompt, you
are definitely bypassing /usr/bin/env and specifying the default python
as the one to use. Solution: type "python3 scriptname" instead. (A more
advanced solution: make scriptname executable and type "./scriptname"
instead. This one uses /usr/bin/env to find the interpreter.)

(You could try "#!/usr/bin/env aintgotnosuch" as your script's hashbang
line to see if it even matters what that line says. Check first that you
don't happen to have a program named "aintgotnosuch" in your path.)

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: I'm a newbie and I'm still stumped... Dwight GoldWinde <Dwight@GoldWinde.com> - 2015-08-03 14:57 +0800
  Re: I'm a newbie and I'm still stumped... Paul Rubin <no.email@nospam.invalid> - 2015-08-03 00:14 -0700
    FW: I'm a newbie and I'm still stumped... Dwight Hotmail <GoldWinde@hotmail.com> - 2015-08-03 16:19 +0800
  Re: I'm a newbie and I'm still stumped... Dave Farrance <df@see.replyto.invalid> - 2015-08-03 09:27 +0100
    Re: I'm a newbie and I'm still stumped... Dwight GoldWinde <Dwight@GoldWinde.com> - 2015-08-03 16:56 +0800
      Re: I'm a newbie and I'm still stumped... Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2015-08-03 12:49 +0300

csiph-web