En Tue, 11 Nov 2008 09:29:44 -0200, Stef Mientki <[EMAIL PROTECTED]>
escribió:
On Tue, Nov 11, 2008 at 8:46 AM, Markus Mayer <[EMAIL PROTECTED]> wrote:
I'm new to python and have a slight problem importing - or maybe
understanding - modules. I'm writing a GUI application using Qt4 and
wanted
> It works when the program you are executing is in the current working
> directory, because Python always puts the directory containing the
> program you are executing (not the current working directory) on the path.
Aha, that makes sense.
I also found with a quick test that importing a module fr
Almar Klein wrote:
> If your main file is in the root of the project, you can just
> use absolute imports. So you can use gui.anotherwindow
> or project.important from all files.
>
> I'm not sure this is good practice though...
>
> I was first under the impression that you can always import
> mod
If your main file is in the root of the project, you can just
use absolute imports. So you can use gui.anotherwindow
or project.important from all files.
I'm not sure this is good practice though...
I was first under the impression that you can always import
modules that are in your current worki
On Tue, Nov 11, 2008 at 7:08 AM, Markus Mayer <[EMAIL PROTECTED]> wrote:
> Steve Holden schrieb:
> > If you want shorter names in your main code, of course, you can use
> >
> > import project.main as main
> > import project.gui.mainwindow as window
> >
> > or somethihg similar.
> >
> > regards
> >
Steve Holden schrieb:
> If you want shorter names in your main code, of course, you can use
>
> import project.main as main
> import project.gui.mainwindow as window
>
> or somethihg similar.
>
> regards
> Steve
Yeah, I was going with the "from x import y" scheme by now, didn't know
"as" was a
Markus Mayer wrote:
> Diez B. Roggisch schrieb:
>> By placing a __init__.py into project, and then
>>
>> import project.main
>> import project.gui.mainwindow
>>
>>
>> Diez
>
> Ouch. Thanks.
>
If you want shorter names in your main code, of course, you can use
import project.main as main
import p
On Tue, Nov 11, 2008 at 8:46 AM, Markus Mayer <[EMAIL PROTECTED]> wrote:
> Hi folks.
>
> I'm new to python and have a slight problem importing - or maybe
> understanding - modules. I'm writing a GUI application using Qt4 and
> wanted to separate the business from the view logic. So I have my folde
Diez B. Roggisch schrieb:
>
> By placing a __init__.py into project, and then
>
> import project.main
> import project.gui.mainwindow
>
>
> Diez
Ouch. Thanks.
Markus
--
PGP/GPG key 0x2EB39BF9
--
http://mail.python.org/mailman/listinfo/python-list
Markus Mayer schrieb:
Hi folks.
I'm new to python and have a slight problem importing - or maybe
understanding - modules. I'm writing a GUI application using Qt4 and
wanted to separate the business from the view logic. So I have my folder
structure as following:
project/ main.py
import
Hi folks.
I'm new to python and have a slight problem importing - or maybe
understanding - modules. I'm writing a GUI application using Qt4 and
wanted to separate the business from the view logic. So I have my folder
structure as following:
project/ main.py
important.py
project/ gui/ __
11 matches
Mail list logo