On Wed, May 25, 2016 at 6:27 PM, Steven D'Aprano
wrote:
> I don't think this is that much different from the way other scripting
> languages handle it. E.g. bash. If I have a set of (say) shell scripts:
>
> fnord/
> +-- foo.sh
> +-- bar.sh
>
>
> where foo.sh runs bar.sh, but fnord is *not* on the
On Wednesday 25 May 2016 14:39, Ben Finney wrote:
> What the Python import system expects you to do is::
>
> cd ../
> python3 -m fnord.foo
I don't think you even need to do the cd provided the fnord directory is inside
a directory on the path. It only gets complicated if fnord cannot be found b
Gerald Britton writes:
> On Wed, 25 May 2016 10:00 am, Steven D'Aprano wrote:
> >The problem is that you are running the Python script from *inside*
> >the package. That means, as far as the script can see, there is no
> >longer a package visible -- it cannot see its own outside from the
> >insid
On 5/24/2016 9:02 PM, Steven D'Aprano wrote:
On Wed, 25 May 2016 09:35 am, Gerald Britton wrote:
For brevity, here's your package setup:
testpkg/
+-- __init__.py
+-- testimport.py which runs "from testpkg.testimported import A"
+-- testimported.py containing class A
Your package layout is cor
On Wed, 25 May 2016 09:35 am, Gerald Britton wrote:
For brevity, here's your package setup:
testpkg/
+-- __init__.py
+-- testimport.py which runs "from testpkg.testimported import A"
+-- testimported.py containing class A
Your package layout is correct. But:
> When I run
>
> python testimport