Thanks
J. Cliff Dyer wrote:
> On Mon, 2009-01-05 at 11:49 -0800, TechieInsights wrote:
> > Ok I have read all of the tutorials and documents I could find. I am
> > running Python 2.6 on windows. The problem I am having with packages
> > is that they don't show up!
> >
> > Simple example of what
On Mon, 2009-01-05 at 11:49 -0800, TechieInsights wrote:
> Ok I have read all of the tutorials and documents I could find. I am
> running Python 2.6 on windows. The problem I am having with packages
> is that they don't show up!
>
> Simple example of what isn't working...
> Structure-
>
> pyte
Ok... I figured it out... you can only import packages via the __all__
= ['subpackage/folder']... if you include a module such as hello.py,
it will fail.
Go figures I'd find this right after posting here...
Greg
TechieInsights wrote:
> Ok I have read all of the tutorials and documents I could fi
cesco wrote:
> I need to instantiate an object (my_object) whose methods I have to
> use in two files (file1.py and file2.py) which are in the same
> directory. Is it possible to instantiate such object in the
> __init__.py file and then directly use it in file1.py and file2.py?
> If not, as I seem
En Tue, 08 Apr 2008 17:51:21 -0300, cesco <[EMAIL PROTECTED]>
escribió:
> I need to instantiate an object (my_object) whose methods I have to
> use in two files (file1.py and file2.py) which are in the same
> directory. Is it possible to instantiate such object in the
> __init__.py file and then
On Tuesday, Apr 8th 2008 at 16:51 -, quoth cesco:
=>Hi,
=>
=>I need to instantiate an object (my_object) whose methods I have to
=>use in two files (file1.py and file2.py) which are in the same
=>directory. Is it possible to instantiate such object in the
=>__init__.py file and then directly u
Jorgen Grahn wrote:
> On Mon, 26 Mar 2007 08:27:19 +0200, Tina I <[EMAIL PROTECTED]> wrote:
>> Tina I wrote:
>>> When looking at other peoples code (to learn from it) I keep seeing an
>>> empty file named "__init__.py". What's the purpose of this?
>>>
>>> Thanks
>>> Tina
>> Duh! Never mind... foun
Jorgen Grahn wrote:
> On Mon, 26 Mar 2007 08:27:19 +0200, Tina I <[EMAIL PROTECTED]> wrote:
>> Tina I wrote:
>>> When looking at other peoples code (to learn from it) I keep seeing an
>>> empty file named "__init__.py". What's the purpose of this?
>>>
>>> Thanks
>>> Tina
>> Duh! Never mind... foun
On Mon, 26 Mar 2007 08:27:19 +0200, Tina I <[EMAIL PROTECTED]> wrote:
> Tina I wrote:
>> When looking at other peoples code (to learn from it) I keep seeing an
>> empty file named "__init__.py". What's the purpose of this?
>>
>> Thanks
>> Tina
>
> Duh! Never mind... found it.
> Kinda neat actuall
Tina I wrote:
> When looking at other peoples code (to learn from it) I keep seeing an
> empty file named "__init__.py". What's the purpose of this?
>
> Thanks
> Tina
Duh! Never mind... found it.
Kinda neat actually :)
T
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
wow ! i tried it and it works like charm!
could access variables declared at root module dir in submodules.
also i would like to know if i can have an abstract class declared in __init__.py with common variables ?
regards,
KMOn 11/14/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
"km" wrote
"km" wrote:
> wow ! i tried it and it works like charm!
> could access variables declared at root module dir in submodules.
> also i would like to know if i can have an abstract class declared in
> __init__.py with common variables ?
you don't really need our permission to try things out, you
"km" wrote:
> I have a structure like this :
> foo/__init__.py
> foo/bar/__init__.py
> foo/bar/firstmodule.py
> foo/abc/__init__.py
> foo/abc/secondmodule.py
>
> now i have some variables (paths to data files) common, to be used in
> first module and second modules respectively.
> can i set those
Hi,
I have a structure like this :
foo/__init__.py
foo/bar/__init__.py
foo/bar/firstmodule.py
foo/abc/__init__.py
foo/abc/secondmodule.py
now i have some variables (paths to data files) common, to be used in first module and second modules respectively.
can i set those variables in foo/
km wrote:
> what is the use of __init__.py file in a module dir ?
it tells Python that the directory is a package directory. if you have
mydir/foo/__init__.py
mydir/foo/module.py
and mydir is on the path, you can do "import foo.module" or "from foo
import module". if you remove the
> Now, why you couldn't do "dbg.DBG = ..."? Very simple... "from
> module import *" doesn't give you a dbg /module/, it only gives you
> references to each piece inside the module.
really the reason why I wanted that should probably be solved in other
ways. I just wanted to split my dbg
In comp.lang.python, hai scritto:
> Sandro Dentella wrote:
>> The structure of my package:
>>
>> python/
>> `-- dbg/
>>|-- __init__.py
>>`-- lib
>>|-- __init__.py
>>|-- debug.py
>>`-- gtk_dbg.py
>>
>> my sys.path includes 'python' and I wanted that the content of d
Sandro Dentella wrote:
> The structure of my package:
>
> python/
> `-- dbg/
>|-- __init__.py
>`-- lib
>|-- __init__.py
>|-- debug.py
>`-- gtk_dbg.py
>
> my sys.path includes 'python' and I wanted that the content of debug.py was
> simply included by: 'import dbg',
Gary Wilson Jr wrote:
I would really like to see an example or situation that makes good
use of the __init__.py file.
I've attached a non-trivial example, from my
PyGUI package. It uses some trickery to switch
in one of a number of subdirectories of platform
specific code, and then imports a bu
Gary Wilson Jr napisał(a):
> What is intended use for __init__.py files?
> Well, I found this: http://www.python.org/doc/essays/packages.html
>>From what I can gather it is for initialization of the package when doing an
> import, but I would really like to see an example or situation that makes g
Le Wed, 08 Jun 2005 10:34:38 -0500, Gary Wilson Jr a écrit :
> I'm creating a python package foo.
>
> What is intended use for __init__.py files?
> Well, I found this: http://www.python.org/doc/essays/packages.html
>>From what I can gather it is for initialization of the package when doing an
> im
On Friday 22 April 2005 07:19 am, codecraig wrote:
> Ok, I have the following directory structure
>
> C:\pycode
>--> blah.py
>--> mynewdir
> --> __init__.py
> --> abc.py
>
> [[ C:\pycode\mynewdir\abc.py ]]
>
> def doFoo():
> print "hi"
>
> def doBar():
> print "bye"
22 matches
Mail list logo