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


Groups > comp.lang.python > #52984 > unrolled thread

Re: multifile programming on python 3

Started byMohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org>
First post2013-08-26 00:01 +0430
Last post2013-08-26 00:01 +0430
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: multifile programming on python 3 Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> - 2013-08-26 00:01 +0430

#52984 — Re: multifile programming on python 3

FromMohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org>
Date2013-08-26 00:01 +0430
SubjectRe: multifile programming on python 3
Message-ID<mailman.225.1377459100.19984.python-list@python.org>
On Sun, 2013-08-25 at 12:13 +0000, Dave Angel wrote:
> Mohsen Pahlevanzadeh wrote:
> 
> > Dear all,
> >
> > I need help about multifile programming on python 3 and i questioned on
> > stackoverflow :
> > http://stackoverflow.com/questions/18391230/eclipse-python-nameerror-name-mymodule-is-not-defined
> >
> > I thank you if you answer me.
> >
> > --mohsen
> 
> You have a response there, so I'm not sure why you're trying to
> duplicate it here.
> 
> A portion of your question there:
> 
> 
> 
> > import repository;
> >
> >
> > x = Repository();
> > When i run my application, i get the following error:
> > 
> > x = Repository();
> > 
> > NameError: name 'Repository' is not defined
> 
> That's not the whole error, that's just the last line of it.  Still the
> immediate answer is clear:
> 
> after the statement
>     import repository
> 
> one new symbol is available to your code, the symbol   'repository'
> 
> if you want to use something defined in that imported module, then use
> 
> obj = repository.Repository()
> 
> 
> 
> Or you could do one of these two:
> 
> import repository
> Repository = repository.Repository   #defines new name for the class
> Materials = repository.Materials       #ditto
> 
> or
> 
> from repository import Repository, Materials
> 
> 
> In either of those latter cases, you could now create the object by
> 
> obj = Repository()
> 
> As for the Eclipse problem, you'll have to study the other answer;  I've
> never found it worthwhile to install Eclipse for Python.
> 
> -- 
> DaveA
> 
> 
At first , thank you, When i post into ML, i get answer on
stackoverflow.

--mohsen

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web