Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.072 X-Spam-Evidence: '*H*': 0.86; '*S*': 0.00; '"my': 0.09; 'nameerror:': 0.16; 'wrote:': 0.18; 'feb': 0.22; 'import': 0.22; 'subject:problem': 0.24; 'fine': 0.24; 'defined': 0.27; 'header :In-Reply-To:1': 0.27; 'tried': 0.27; 'function': 0.29; 'message- id:@mail.gmail.com': 0.30; 'received:209.85': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'received:209': 0.37; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'name': 0.63; '2015': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=hmW3zXEU8ghtvCNBoUM3LGG3NOTMg5FP04ft8FhhO+M=; b=vSuMHZkEbMcm11BciRxRy0c10hLlZJy+zam9XM8LUoSZTh8VNmLWSVWYLno1XJP+oG 8aSsCGgi07WnsxIe+GCPS2DmwOtlvSHS6KPvKLeCocUdwLbOkeKFGedx0AYfRmPKXaGn Zu0taOnkYFPMMuqcbRal+UZkjcGi0marITzuWYid+VEUULkPeeKjEtwVlgiT48Y69qpx hZrPcro68LAZXVd0ZCg6pWh9x64jWF04YCEGucFGW/xSvk/cKFr4YrcXtfD+bfvpAFZW fHVsCrsnC1DFqOUC6Tz9dtMUpdGJVHxJK79QHt5yvpf4QS4izD6dDBvtbwwVHHjhS/0r q0jA== X-Received: by 10.66.221.194 with SMTP id qg2mr9551304pac.106.1423612995933; Tue, 10 Feb 2015 16:03:15 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Tue, 10 Feb 2015 17:02:35 -0700 Subject: Re: function inclusion problem To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1423613005 news.xs4all.nl 2917 [2001:888:2000:d::a6]:40447 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:85486 On Tue, Feb 10, 2015 at 4:38 PM, wrote: > 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? import mydef mydef.Fatalin("my test") or from mydef import Fatalin Fatalin("my test")