Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #108104

Re: How to call a Python Class?

From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: How to call a Python Class?
Date 2016-05-04 09:14 +1000
Message-ID <mailman.367.1462317282.32212.python-list@python.org> (permalink)
References <1659145888.152847.1462316185321.JavaMail.yahoo.ref@mail.yahoo.com> <1659145888.152847.1462316185321.JavaMail.yahoo@mail.yahoo.com> <CAPTjJmqvzQXB4dSDeGpPy-uAwFCAqTtFkgQJJCoOYVjj-mT2Gg@mail.gmail.com>

Show all headers | View raw


On Wed, May 4, 2016 at 8:56 AM, David Shi via Python-list
<python-list@python.org> wrote:
> I found a Python class within an Open Source software.
> I would like to use it in my own Python script.
> I tried to import it, but I got following message.
> from intersection import *Traceback (most recent call last):  File "<pyshell#4>", line 1, in <module>    from intersection import *ImportError: bad magic number in 'intersection': b'\x03\xf3\r\n'
> Can any one help?
> Regards.

Did you get a .py file, or only a .pyc? Try deleting all .pyc files
that you downloaded, and try again.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: How to call a Python Class? Chris Angelico <rosuav@gmail.com> - 2016-05-04 09:14 +1000

csiph-web