Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'compiler': 0.07; 'skip:" 60': 0.07; '#define': 0.09; '#include': 0.09; 'main()': 0.09; 'skip:/ 10': 0.09; 'python': 0.11; '#ifndef': 0.16; 'nameerror:': 0.16; 'programmers.': 0.16; 'subject:import': 0.16; 'subject:python': 0.16; 'prevent': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'import': 0.22; 'subject:problem': 0.24; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'code': 0.31; "skip:' 10": 0.31; 'header,': 0.31; 'file': 0.32; 'class': 0.32; '(most': 0.33; 'but': 0.35; 'yours,': 0.36; 'to:addr:python-list': 0.38; 'recent': 0.39; 'explain': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'even': 0.60; 'skip:u 10': 0.60; "you'll": 0.62; 'name': 0.63; 'dear': 0.65; 'confusing': 0.84; 'skip:/ 30': 0.84 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pahlevanzadeh.org; s=default; h=Content-Transfer-Encoding:Mime-Version:Content-Type:References:In-Reply-To:Date:To:From:Subject:Message-ID; bh=gwS+u5Ch7B5cruiQm9177s2UDETvVRF3aB4HtnWfadA=; b=t4qlMSqBvKCVC+UOEalvVnlqHodxqW+Cu5Zni2FdX4brrkj9C+WQ91SxNSEHij97plUIo2GZO+3gk6DY+HbxsHSc7DPuLHjBf4gUpVLwiquXTokPBlC2/D5mCE68w331Owl9UQtyGPz2NkyAIuXZqQiSRPA9pOMCFuN7FFX/gXg=; Subject: Re: problem of double import in python From: Mohsen Pahlevanzadeh To: python-list@python.org Date: Tue, 03 Sep 2013 05:46:26 +0430 In-Reply-To: <1378169284.6921.16.camel@debian> References: <1378169284.6921.16.camel@debian> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4-4+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - part7.royal-servers.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pahlevanzadeh.org X-Get-Message-Sender-Via: part7.royal-servers.com: authenticated_id: mohsen@pahlevanzadeh.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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378170996 news.xs4all.nl 15908 [2001:888:2000:d::a6]:34917 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53548 When i uncomment //// from common.interface.interface import ShowHide //// in file contains Ui_Materials class i get the following traceback: ////////////////////////// Traceback (most recent call last): File "./main.py", line 110, in main() File "./main.py", line 91, in main interfaceObj.showMaterials() File "/home/mohsen/codes/amlak/amlak/src/common/interface/interface.py", line 80, in showMaterials self.ui = Ui_Materials() NameError: global name 'Ui_Materials' is not defined ////////////////////////////////// Yours, Mohsen On Tue, 2013-09-03 at 05:18 +0430, Mohsen Pahlevanzadeh wrote: > Dear all, > > I remember to avoiding to confusing compiler for header, use > ///////////////// > // in my include file > #define MYHEADER_H > // and in others code use: > #ifndef MYHEADER_H > #include blahblah > ///////////////////////// > > Unfortunately, i prevent to same error, double import to python, but i > don't know how to solve, Even i don't know policy of python programmers. > > You'll make me happy if explain me... > > Yours, > Mohsen >