"Ian Kelly" wrote in message
news:calwzidm3khnagtt0ohveo5bhqk1tfejbuuuinw9tnuxrpnr...@mail.gmail.com...
On Thu, Sep 10, 2015 at 1:12 AM, Frank Millman wrote:
> That makes me wonder if, in my project, I can import all modules inside
> 'start.py', and then just use 'import package_name' inside
"Frank Millman" writes:
>...
> My project comprises a number of modules, split into packages. Modules
> frequently need to access the contents of other modules, in the same
> or in a different package. I am getting better at it, but I still
> occasionally bump my head against circular imports, and
On Thu, Sep 10, 2015 at 8:47 AM, Peter Otten <__pete...@web.de> wrote:
> Ian Kelly wrote:
>> That surprises me also, but I suspect it's because they're
>> subdirectories of the current working directory rather than packages
>> found on the sys.path.
>
> So even the experts cannot keep up with all t
Ian Kelly wrote:
> On Thu, Sep 10, 2015 at 1:12 AM, Frank Millman wrote:
>> That makes me wonder if, in my project, I can import all modules inside
>> 'start.py', and then just use 'import package_name' inside each module?
>
> You can, but for readability and reuse I think it's better to be
> ex
On Thu, Sep 10, 2015 at 1:12 AM, Frank Millman wrote:
> That makes me wonder if, in my project, I can import all modules inside
> 'start.py', and then just use 'import package_name' inside each module?
You can, but for readability and reuse I think it's better to be
explicit in each module and im
On 23/11/2013 12:23, Ed Schofield wrote:
Hi all,
I am the author of the ``future`` package for Python 2/3 compatibility
(http://python-future.org). A bug report has recently been posted about its use
of import hooks that I don't yet have an answer for, and I am looking for some
guidance on ho
On Jun 11, 1:45 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> Is it cursed upon? Didn't know that.
I didn't either. Until I asked some people how to do it, and was
admonished for even suggesting the concept.
> However, __import__ only gives you the topmost module - in your case myapp.
ah,
Jonathan Vanasco schrieb:
I'm a little unclear about import / __import__
I'm exploring dynamically importing modules for a project, and ran
into this behavior
works as expected:
app = __import__( myapp )
appModel = __import__( myapp.model )
but...
appname= 'myapp'
app = __impor
Frank Millman wrote:
> One small point. The docs have the following warning -
>
> "Important: the caller is responsible for closing the file argument, if
> it was not None, even when an exception is raised. This is best done
> using a try ... finally statement. "
>
> I have added this to my code.
Rob Wolfe wrote:
> Frank Millman wrote:
> > Hi all
> >
> > However, I want the ability to have duplicate program names stored in
> > different subdirectories. At the time of selecting the menu option I
> > know which company is active, so I know which directory I want to run
> > the program from,
Frank Millman wrote:
> Hi all
>
> I am writing a business/accounting application. Once a user has logged
> in they are presented with a menu. Each menu option has a description
> and an associated file name and program name. The file name is the name
> of a .py file (impName) and the program name
Ok, thanks again. That was helpful.
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, jdemoor wrote:
>> from module import *
>> import module
>>
>> as these kinds of import are not mutually exclusive.
>
> Would this run the code in 'module' twice, or just make the objects in
> it accessible by several names ?
The code at module level is only executed at fi
[EMAIL PROTECTED] wrote:
> Thanks for the replies.
>
>> You can do both
>>
>> from module import *
>> import module
>>
>> as these kinds of import are not mutually exclusive.
>
> Would this run the code in 'module' twice, or just make the objects in
> it accessible by several names ?
The latter
Thanks for the replies.
> You can do both
>
> from module import *
> import module
>
> as these kinds of import are not mutually exclusive.
Would this run the code in 'module' twice, or just make the objects in
it accessible by several names ?
--
http://mail.python.org/mailman/listinfo/python-l
[EMAIL PROTECTED] wrote:
> I'm new to Python and have the following problem :
> I have an application started by a main.py file, which does a ' from
> module_1 import * '.
> main.py is responsible from the creation of an object which is then
> used in module_1.
> What is the best way to make that
In <[EMAIL PROTECTED]>, jdemoor wrote:
> I have an application started by a main.py file, which does a ' from
> module_1 import * '.
> main.py is responsible from the creation of an object which is then
> used in module_1.
> What is the best way to make that object visible in the module_1
> namesp
17 matches
Mail list logo