Laura, thanks for the answer - it works. Is there some equivalent of "include" to expose every function in that script? Thanks again, -V
On Tue, Feb 10, 2015 at 7:16 PM, Laura Creighton <l...@openend.se> wrote: > In a message of Wed, 11 Feb 2015 01:06:00 +0100, Laura Creighton writes: > >In a message of Tue, 10 Feb 2015 15:38:02 -0800, vlyamt...@gmail.com > writes: > >>I defined function Fatalln in "mydef.py" and it works fine if i call it > from "mydef.py", but when i try to call it from "test.py" in the same > folder: > >>import mydef > >>... > >>Fatalln "my test" > >>i have NameError: name 'Fatalln' is not defined > >>I also tried include('mydef.py') with the same result... > >>What is the right syntax? > >>Thanks > >>-- > >>https://mail.python.org/mailman/listinfo/python-list > > > >from mydef import Fatalln > > > > Also, please be warned. If you use a unix system, or a linux > system. There are lots of problems you can get into if you > expect something named 'test' to run your code. Because they > already have one in their shell, and that one wins, and so ... > well, test.py is safe. But if you rename it as a script and call > it the binary file test ... > > Bad and unexpected things happen. > > Name it 'testme' or something like that. Never have that problem again. > :) > > Been there, done that! > Laura > >
-- https://mail.python.org/mailman/listinfo/python-list