Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'example:': 0.03; 'subject:: [': 0.03; 'subject:Python': 0.05; 'attribute': 0.05; 'subject:help': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:2.7': 0.09; 'subject:Help': 0.10; 'received:80.91.229.3': 0.16; 'received:dip.t-dialin.net': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-dialin.net': 0.16; 'subject:] [': 0.16; 'thread.': 0.16; 'variable.': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'subject:] ': 0.19; 'question.': 0.20; '"",': 0.22; 'example': 0.23; 'tried': 0.25; 'header:User-Agent:1': 0.26; '(most': 0.27; 'question': 0.27; 'header:X-Complaints-To:1': 0.28; 'actual': 0.28; 'related': 0.30; 'function': 0.30; 'file': 0.32; "skip:' 20": 0.32; 'print': 0.32; 'traceback': 0.33; 'to:addr :python-list': 0.33; 'thanks': 0.34; 'built-in': 0.35; 'open': 0.35; 'something': 0.35; 'received:org': 0.36; 'but': 0.36; 'should': 0.36; 'subject: (': 0.36; 'previous': 0.37; 'object': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'curs': 0.84; 'understood.': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Date: Sun, 23 Dec 2012 22:14:37 +0100 Organization: None References: <37264cd5-8acd-416b-a808-50216f9fbfa0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: p508499ec.dip.t-dialin.net User-Agent: KNode/4.7.3 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: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356297278 news.xs4all.nl 6913 [2001:888:2000:d::a6]:33234 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35414 prilisauer@googlemail.com wrote: > Thanks to all your answers, I have read a lot about namespaces, but still > there's something I do not understood. I have tried your example but as I > expected: > > line 13, in HandoverSQLCursor > curs.execute("SELECT * FROM lager") > AttributeError: 'builtin_function_or_method' object has no attribute > 'execute' You have assigned a built-in function to the curs variable. Example: >>> curs = open >>> curs.execute Traceback (most recent call last): File "", line 1, in AttributeError: 'builtin_function_or_method' object has no attribute 'execute' You can find out the name of the actual function with >>> print curs.__name__ open PS: This question is only loosely related to your previous question. You should have started a new thread.