Cross-platform way to get default directory for binary files like console scripts?

Ned Batchelder ned at nedbatchelder.com
Thu Feb 20 11:26:31 EST 2014


On 2/20/14 10:55 AM, Oscar Benjamin wrote:
> On 20 February 2014 15:42, Ned Batchelder <ned at nedbatchelder.com> wrote:
>>
>> As roundabout and advanced as that code is, it doesn't give the right answer
>> for me.  It returns None.  On my Mac, after activating a virtualenv:
>>
>>      Python 2.7.2 (default, Oct 11 2012, 20:14:37)
>>      [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on
>> darwin
>>      Type "help", "copyright", "credits" or "license" for more information.
>>      >>> from distutils.command.install import install
>>      >>> from distutils.dist import Distribution
>>      >>> c = install(Distribution())
>
> You forgot to call  c.finalize_options() here which actually sets all
> of these attributes.
>

Ah, good! Thanks!


-- 
Ned Batchelder, http://nedbatchelder.com




More information about the Python-list mailing list