| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Comments:
<0> well, it's easy to make it spam, even if I add timers <0> because it doesn't wait for the first thing to run before it runs a new instance <1> kbrooks, I can admit I'm new and I'm doing something wrong, but I think I'm being fair that with that code, the mention of 2 or 3 args is not helpful. <2> halley, <2> import Item <2> cl*** Group (Item): <0> is there any decently easy way to do that <2> WRONG <2> Item.Item <2> # Antic/__item__.py <2> __all__ = [ 'Store', 'Item', 'Core' ] <2> Do you mean __init__.py? <1> Er, yeah, __init__.py <2> halley, ls -l Antic <1> $ ls -l Antic/ <1> total 16
<1> -rw-rw-r-- 1 halley halley 115 2006-02-20 19:00 Core.py <1> -rw-rw-r-- 1 halley halley 59 2006-02-20 18:58 __init__.py <1> -rw-rw-r-- 1 halley halley 90 2006-02-20 18:58 Item.py <1> -rw-rw-r-- 1 halley halley 68 2006-02-20 18:59 Store.py <2> just checkng <2> you shouldnt subcl*** modules <1> I don't want to subcl*** modules. I don't want the name of the cl*** to be Item.Item either. <1> Why must filenames become part of symbols when I split things up? <3> halley "from Item import Item" <2> halley, get to the damn problem and solve it, damn it <1> kbrooks, can you get maybe just a little less ***holish if you're trying to help someone? <2> halley, aso, sys.path ALREADY INCLUDES . <1> Thanks Zalamander. <3> np <1> I thought I tried that in my larger real code, lemme put that back in and try it. <2> halley, i am TRYING to help you. but you'renot helping me by ayttempting to solve the problem. <2> halley, module.attribute <2> halley, so Item.Item <1> Shouting "WRONG" and talking about things in terms of some mystical understanding of python internals that newcomers don't yet understand doesn't help. <4> New question: I have two lists. The first is four numbers long and the second two. I want to add the second list with the latter half of the first list. [0,0,0,0] and [2,3] to get [0,0,2,3]. <2> Item is the module, and Item is the attribute <4> er newb question. <2> halley, this is not python internals. this is reality. <2> halley, import Item does not get everything from the Item module. <2> Do you understand? <3> eugman you can use "slice ***ignment", like so: first[-len(second):] = second <5> eugman: is the first list always four elements? <4> yes <5> first[2:] + second <4> perfect thanks. <1> Zalamander, thanks again, that works fine. <1> I must have not tried the from Item import Item properly. <1> Nobody has yet explained why the error mentions 2 or 3 arguments, but whatever. :) <3> halley modules have "__init__" methods, and one was being called in your code with the wrong number of arguments <6> some path problems here... I have a package tree, like A/B/X, A/B/Y, A/B/Z, etc... inside X, Y and Z I have an images directory, where are stored some images loaded with PIL and used by the main code at A... if on the modules inside X, Y, Z I use the relative path, ./images, I get a path error when importing them and using the modules from A... how to solve this ? <1> Ah, so if I don't have a file-scope 'def __init__' there is one made for me? <3> halley yes <1> That makes sense, sorta. What args does it take, normally? <3> halley normally, one doesn't create module-level __init__'s, and doesn't call them, and doesn't worry about them. So I don't know. <3> halley you were accidently calling one, so ... ;-) <1> Because my cl*** name happened to match the module name. <3> yep <1> Okay, that was helpful. <1> From the caller's point of view, it will look like cl*** Antic.Item, right? <1> Not Antic.Item.Item? <3> if you have "from Item import Item", yes. That puts the cl*** Item, from the module Item, into the module Antic's namespace <5> I think Zalamander is mistaken about what's happening <3> quite possible :-) <5> it's not a particular module's __init__, but the __init__ of the module type itself <1> That fits with the message: it loads a new file, it makes an internal instance of cl*** module. Right? <5> right <2> right ... but you can't see "module" as a builtin <2> i think <5> no <2> deltab, ? <1> >>> s = Store() <1> Traceback (most recent call last): <1> File "<stdin>", line 1, in ? <1> TypeError: 'module' object is not callable <1> Same if I try s = Antic.Store()
<5> but you can get to it through types.ModuleType or type(any module) <7> >>>>>>>buy pixel puer 1cent<<<<<< <7> http://www.100dollarhomepage.er1.be <7> >>>Own a piece of internet history<<< <8> "Requirements: Bachelor's degree (B.A./B.S.) from an accredited college or university; two years of programming experience; or equivalent combination of education and experience; Computer Skills: 1337; Expertise with web programming: (X)HTML, HTTP, Javascript, CSS, XML; Fluency with one or more object-oriented languages, preferably Python; Experience with databases, including SQL; Flexibility to adjust to changes as our organization grows; Proficient in <8> use of Web authoring tools, HTML and script writing." uhh, 1337 ? <5> halley: those are modules, not cl***es <9> 1337=leet=expert <5> I advise not giving modules names with uppercase letters <8> right, but something tells me "wendy" at Amor Ministries doesn't know what the hell that means. <5> and so does PEP 8 <10> NaeRey: aolspeek is strictly forbidden here. <10> witless: I recommend advertising on the python job board. <8> Jerub: i'm not advertising. <9> Jerub, now, witless just asked what 1337 means. <10> ahh <8> no, dammit, i was pointing at something amusing. <2> 1337 1337 1337 <2> kick me if you like <1> deltab, how can I make it such that the caller deals with cl***es Antic.Store() and completely hides/melts/obscures the module symbols? <1> A caller shouldn't have to understand the internal layout of a package. <10> sorry, just about every alarm went off. <11> 3....2....1... ;) <2> witless, are you saying that saying 1337 in a resume is unprofessional? <9> Jerub, your client beeps when it hears leetspeek? <5> halley: have antic/__init__.py import them <10> NaeRey: no, I just saw a flood followed by leetspeek <10> ;) <8> kbrooks: just a bit odd in a job advertisement` <10> witless: I'm sorry, it just looked odd the way you joined and pasted that. <2> witless, but is it unprofessional? <10> witless: I get all sorts here :( <1> Ooo. So it can do the import Cl*** from Module etc, and it promotes it up a level? <9> Jerub, flood is 3 lines or more <8> Jerub: i know, sorry :-) <2> halley, No . <9> or wait thats spam... <11> no, spam's canned ham <9> cjfs, thats hard with python <2> NaeRey, flooding != spamming <10> the definitions are meaningless. <2> NaeRey, spamming is sending useless, or redundant, things. <5> spamming involves repetition <2> deltab, that too. <9> deltab, not really <2> flooding involves ... oh how about we drop it? <2> please. <2> its over. <5> okay <9> spam email is not one that you get 50 times.. its one you don;t need.. <2> Jerub misunderstood. and we cleared it up. <9> kbrooks, you started it.. but ok <2> why discuss it any further? <9> ... <2> NaeRey, what. <9> ...anyways, i was looking for something along the lines of "good cl*** tutorial" <1> # Antic/__item__.py <1> __all__ = [ 'Store', 'Item', 'Core' ] <1> from Store import Store <1> deltab, like that? <1> Still can't make an Antic.Store() or a Store() <11> NaeRey: http://docs.python.org/tut/node11.html <1> Dang, that typo again. <5> halley: I still advise renaming the modules <9> cjfs, except that? <1> deltab, to completely unused names? Fair enough. <2> no... <0> can anyone help me with stopping a script from multithreading(as in running more than once at the same time)? <5> halley: you're using the same name for different things: that can't be helping understand what's happening <1> deltab, I agree. <11> NaeRey: what else do you want to know?
Return to
#python or Go to some related
logs:
qualityhostonline sucks crx1f15d
debian ckfs suse usb slow eject -e -u Benje Walters xferreport module sapr3 dapper #linux #ldap #kde
|
|