| |
| |
| |
|
Comments:
<0> sup people. <1> yeh <2> why is from foo import bar working, but not from foo.bar import bar? <2> or what's the difference? <3> foo has to be a module <3> if foo.bar is a module, it should work <3> it's a little weird, but sometimes foo.bar is a module (you can import it) and sometimes it isn't <2> foo.bar has an __init__.py and it has several cl***es defined in it
<3> then I have no idea <2> heh.. i need to read more <4> you'll have to be clearer about what your setup is <4> if foo is a package (directory which contains __init__.py) and bar is a module inside it (bar.py inside foo directory), then from foo import bar is correct <4> from foo.bar import bar is incorrect] <4> from foo.bar import bar tries to import a module bar from a package foo.bar <4> i.e., the thing you're importing is foo.bar.bar <4> that would correspond to foo/bar/bar.py <2> thanks, xihr (as usual) <4> sure <2> one more thing <2> which is preferred: cursor.fetchall()[0][0] or return [i[0] for i in cursor.fetchall()]? <2> or is it 6 of 12... half a dozen of another <3> I don't think those do the same thing <4> well those don't do the same thing <2> hmm <2> well, it doesn't matter then <2> haha <4> if A is a sequence of sequences, then A[0][0] is the first element of the first sequence <4> [i[0] for i in A] is a list of the first elements of each seqeuence <2> ohhh... but if there's only going to be one item, then i guess the former should suffice <4> yes <4> in that case they still won't be the same, though; one will be an element, and the other will be a list (with only one element) <3> xihr: do you mind at all if I ask you something privately? <4> why <3> because it's not related to python <4> sure <3> and I think I'd just annoy everyone else <2> ok, i have models/RT.py (which has def _module_get_foo() and cl*** Cars), models/__init__.py (which just has __all__ = ['RT']). now i need access RT.Cars and RT._module_get_foo... so how would i do this? from models/RT import Cars; from models import RT? <4> from models.RT import Cars, _module_get_foo
<2> ok... i don't know why namespaces are confusing me <2> i got it now <2> thanks, xihr <4> sure <4> when you use from M import X, M is always a package/module, and X is a thing inside it <2> so package = directory, module = python file, X = cl***/def/... <2> ? <4> yep <2> ok, night <5> I wonder if anyone has made a native cl*** for real numbers. <6> hi <6> i'm looking for a way to access a method from its body <6> is that even possible? <5> "self.methodname()" <7> howdy hund <5> Hello Joe. <5> Yay. <7> Woof. <5> Yay, I finally groked the concept of zero-knowledge protocols. <5> Plser. <5> #wrong <7> Bratwurst. <7> #wrong <5> SgtUnix: Did you eat it? <7> hund: I luv bratwursts. <5> SgtUnix: http://www.aftenposten.no/nyheter/okonomi/article1261071.ece <5> :D:D:D <5> (Not English) <7> hund: oh my :) <5> Oh yes. <7> BI ranks higher than NHH these days though, I heard. <7> I do all ***ignments in TeX nowadays, I'm hooked. <4> heh <4> just have to get over the hump
Return to
#python or Go to some related
logs:
#worldcup caiwhiqk #computers #sql #computers #worldcup bart pe + c0000221 unkown had error
+torchwood +uue calandar layout for indesign
#freebsd
|
|