Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #85527
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <vlyamtsev@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.007 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'binary': 0.07; 'laura': 0.07; 'rename': 0.07; '"my': 0.09; 'creighton': 0.09; 'happen.': 0.09; 'works.': 0.09; 'cc:addr:python-list': 0.11; '>>': 0.16; '>in': 0.16; 'nameerror:': 0.16; 'script?': 0.16; 'unexpected': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'wed,': 0.18; 'feb': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'subject:problem': 0.24; 'fine': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'script': 0.25; '>': 0.26; 'equivalent': 0.26; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'function': 0.29; 'unix': 0.29; 'message- id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'that.': 0.31; '+0100,': 0.31; 'writes:': 0.31; 'file': 0.32; 'run': 0.32; 'linux': 0.33; 'url:python': 0.33; 'there,': 0.34; 'problem': 0.35; 'something': 0.35; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'that!': 0.36; 'done': 0.36; 'url:listinfo': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'system,': 0.38; 'skip:& 10': 0.38; 'problems': 0.38; 'pm,': 0.38; 'expect': 0.39; 'skip:& 20': 0.39; 'bad': 0.39; 'system.': 0.39; 'url:mail': 0.40; 'email addr:gmail.com': 0.63; 'name': 0.63; '>from': 0.68; "'test'": 0.84; '2015': 0.84; 'expose': 0.84; 'safe.': 0.84; 'shell,': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=LZNz66bKlQ2KnJZpKxBZstg0QbpWTYTgw9QBOUEgUFg=; b=mJzUg6mI5fZJTMhuvP8C9D76BaSuF+AhFUWvl7zIPZEtNVdyXqd0P/rs5V+QlQSYke 8lxIJRYaNjJBv/xx7XpOVcFveTdQweWVRe9/ey0uZiuyotysn5m4nvy1kjkotL/SV6YA Nj/UviZR3LQL45TTSLxpKPEAsSyYYtAobtrv9lylih8bpkRJdaV5WD6+eEaJcf8cp91K b8wr6UpPXKinJVJYvpWFx/ysaq1orPbLP3kNlknNzvbljkem5tGe+OhLwU33ngh3O2NO /fD49s3LLCe0ToVjd6vEf6O4/7NMOuva+RflDnwv8W9ocgDq1YMELfUNBy6Ra5pI21Qj 8+vA== |
| MIME-Version | 1.0 |
| X-Received | by 10.50.39.112 with SMTP id o16mr3585213igk.0.1423661247020; Wed, 11 Feb 2015 05:27:27 -0800 (PST) |
| In-Reply-To | <201502110016.t1B0GVah024279@fido.openend.se> |
| References | <d7871507-2677-4fef-9462-d429217e7ad3@googlegroups.com> <lac@openend.se> <201502110006.t1B060VZ021974@fido.openend.se> <201502110016.t1B0GVah024279@fido.openend.se> |
| Date | Wed, 11 Feb 2015 08:27:26 -0500 |
| Subject | Re: function inclusion problem |
| From | Victor L <vlyamtsev@gmail.com> |
| To | Laura Creighton <lac@openend.se> |
| Content-Type | multipart/alternative; boundary=047d7bdca2f4e8c636050ecff692 |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.18654.1423661250.18130.python-list@python.org> (permalink) |
| Lines | 100 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1423661250 news.xs4all.nl 2939 [2001:888:2000:d::a6]:41371 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:85527 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
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 <lac@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, vlyamtsev@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
>
>
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
function inclusion problem vlyamtsev@gmail.com - 2015-02-10 15:38 -0800 Re: function inclusion problem sohcahtoa82@gmail.com - 2015-02-10 15:55 -0800 Re: function inclusion problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-11 10:57 +1100 Re: function inclusion problem Michael Torrie <torriem@gmail.com> - 2015-02-10 17:00 -0700 Re: function inclusion problem sohcahtoa82@gmail.com - 2015-02-10 16:02 -0800 Re: function inclusion problem Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-10 17:02 -0700 Re: function inclusion problem Laura Creighton <lac@openend.se> - 2015-02-11 01:06 +0100 Re: function inclusion problem Laura Creighton <lac@openend.se> - 2015-02-11 01:16 +0100 Re: function inclusion problem Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-02-10 20:52 -0500 Re: function inclusion problem Victor L <vlyamtsev@gmail.com> - 2015-02-11 08:27 -0500 Re: function inclusion problem Dave Angel <d@davea.name> - 2015-02-11 10:07 -0500 Re: function inclusion problem Tim Chase <python.list@tim.thechases.com> - 2015-02-11 09:22 -0600 Re: function inclusion problem Chris Angelico <rosuav@gmail.com> - 2015-02-12 02:37 +1100 Re: function inclusion problem blue <catalinfest@gmail.com> - 2015-02-27 12:11 -0800
csiph-web