[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Re: gr_python.m4
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] Re: gr_python.m4 |
Date: |
Mon, 11 Jul 2005 16:18:48 -0700 |
User-agent: |
Mutt/1.5.6i |
On Tue, Jul 12, 2005 at 12:54:21AM +0200, Martin Dvh wrote:
> Eric Blossom wrote:
>
> >OK.
> >
> >Running python on windows, can you please send me the output of this:
> >
> >$ python
> >
> >>>>import distutils.sysconfig
> >>>>print distutils.sysconfig.get_python_inc(plat_specific=False)
>
> This is similar to what I did before my last post.
> If I start the python command promt on windows and just type in:
> import distutils.sysconfig
> print distutils.sysconfig.get_python_inc(plat_specific=False)
>
> The output is:
> D:\Python24\include
>
> Which is probably NOT good.
> Since we are building using m4 macros and configure scripts and makefiles
> which all interpret a backslash as a special character.
> If the output were /d/Python24/include (or possibly even
> d:/Python24/include) There would probably not be a problem.
OK. I understand what you're saying. However, we can easily massage
this into something that works on all platforms.
I think this will work on all systems:
import distutils.sysconfig
import os
path = distutils.sysconfig.get_python_inc(plat_specific=False)
if os.sep == '\\':
path = path.replace('\\','/')
print path
We could just blindly preform the replace, but that fails on the
pathological case of *nix filenames with literal \'s in them.
Eric