| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Comments:
<0> nothing to do with snakes :) <1> yeah, that's why I asked <1> I see a lot of references in the docs <2> i should make a language called akbar and put lots of "its a trap" refs in the docs <3> heheh <4> clear <5> How can i append something to a dict? <6> dicts aren't ordered <7> molsen your_dict[key] = new_thing <8> molsen: mydisc[mykey] =myval <9> dictname[newkey]=value <5> So i should use dict[key] = val ? :) <10> hey molsen, in case you don't know: dictname[newkey]=value <10> haha
<11> anyone can help with a list in pygtk? something like a grid.. i m reading this stuff but i cant understand it at all http://pygtk.org/pygtk2reference/cl***-gtkliststore.html <7> molsen you can use dict.__setitem__ if you're masochistic :-) <12> Hello <13> Is there some way in python to run iterations on all the FILES in the argv list? For example, I've seen it done in perl this way: foreach $file (@ARGV) <9> hwllo wundo <12> There is any way to Copy all the "content" of an object to another? <6> sapo, take a look at the tutorial, http://pygtk.org/pygtk2tutorial/ch-TreeViewWidget.html <8> Toran: for x in argv <13> Wait, I knew that. <13> Thanks :) <12> I have a mechanize object named mech1, I want to copy (COPY not POINT) it contents to mech2... how can I do that? <8> wundo: eg a clone, new instance etc <8> ? <12> m0no yeah, a clone describe exactly what I want. <12> m0no how can I do that? <11> Juhaz, i was reading that.. but its too confusing and dont have simple examples :( <11> Juhaz, i just want to make something like: 2 colums with a header and some row with data but seens too complicated :( <14> wundo, you can generally use copy.copy, but I suspect the mechanize browser object has open sockets, which aren't copyable <6> sapo, string columns? <11> Juhaz, yes <12> hm.. ok benji, thanks... I remembered that mechanize have .back, I think I can use it. <11> Juhaz, that example is making a tree.. i want a list <6> sapo, moment <11> Juhaz, ok, thanx <6> sapo, http://rafb.net/paste/results/H45W2720.html <15> Is it possible for an object to transform itself into another object? <15> I have a cl*** representing exponential functions and one representing logarithms, so I want e^ln(x) to become x. However, this requires the exponential function object to be able to "transform" itself into an object of another clas... <16> how are you supposed to know what the "options" are supposed to be in PIL's ellipse? <17> sp3tt: Well, self.__cl***__ = NewCl*** <15> Will that overload all methods and attributes? <17> sp3tt: Any questions left? <18> sp3tt: I can't quit see why you want to transform anything. Surely it's the result, which is a new object, that is to be x. <15> The result...? <18> Yes. I ***ume you are writing some sort of symbolic algrebra thing. <15> Symbolic calculus, really. <15> The point is that exponentials are one cl***, and logarithms another. <18> Then I would implement a simplify method which tries to simplify nodes according to some rules. <18> E.g. in this case yo have presumalby something like Pow(Constant('e'), NaturalLogirthm(Variable('x')) <11> Juhaz, thanx, you example worked.. but i have a problem :( i ve designed my gui using glade.. and i dont know how to make them work togete.. omg :( <19> anyway to list all instance variables of a cl***? <20> sapo: There's tepache <15> When I create a new Exponential object, I wish it to simply itself using that e^ln(x)=x. <18> Pow's simplify method would then see: if left hand side is Constnat('e') and right hand side is NaturalLogirthm(expr) then I should simply myself to just the exprt <6> sapo, well, the example p***ed the liststore to treeview constructor, but you can just use .set_model() afterwards <18> What would happen is that you first construct your complex tree, and then visit every node and let it first simplify its sub expression, and then simply itself, using the rules it knows <6> to set it for glade-created treeview <15> Actually, it's Exponential(Polynomial({1:1}))... <18> So you will not modify existing objects, but construct new ones, replacing nodes in your tree with simplifed versions <15> Yes, objects simplify themselves when created. <19> ie: list the actual name of the instance varibles... <18> Well, if you do it on creation time then you make a factory method <18> E.g. Exponenential.create(...) will not create an Exponential but something else in certain cases <13> OK, is there a way for me to get the place of a certain value in a list? <18> Changing self.__cl***__ is not going to work in the long run <21> hi <21> i've got a question: <15> Can't one overload __new__ or something to get that effect? <21> how can i use very long integers (100+ digits) <18> sp3tt: Yeah, but I think it would be butt-ugly <11> Juhaz, take a look: http://rafb.net/paste/results/ZH0Tbd72.html <17> datbenik: Just use them.
<21> is it possible? <17> >>> 10**100 <17> 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000L <11> Juhaz, but i m getting this error: clientes.set_model(tree) <11> TypeError: model should be a GtkTreeModel or None <21> wow <17> >> 2**1024 <17> 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216L <6> sapo, remove the third line, and use clientes.set_model(list) <6> sapo, and, unless glade has a column editor, make lines 4 and 5 use "clientes" instead of tree as well <18> That's nothing, try this: <18> >> print 1/0 <18> Python will actually print all the digits of infinity when you do that -- it's so powerful. <7> Erwin <sigh> mine's still going.... how long is this supposed to take? <11> Juhaz, man.. o love you.. that worked =* <21> but how can i do a math.sqrt(verylongint) <12> what is wrong with this: links = re.compile('<td><a href="javascript:__doPostBack(\'(.*?)\',\'(.*)\')">(.*?)</a></td>', re.DOTALL) ? This lines exists in the str, but when I do: for link in links.findall(conteudo): it returns nothing.... <21> OverflowError: long int too large to convert to float <11> Juhaz, i didnt understand exactly how this stuff works.. but at least it works :) <22> hmm i have for ex. this string a = "blah http://google.com ble" how can i get from this string only http://google.com? <23> wundo: you didn't escape all the reserved characters <12> loufoque what reserved ? I scaped all the ' <24> can I use the subprocess module to get the output of a command? <12> loufoque can you tell me what more I need to escape please? <0> genia4_: rtfm http://www.python.org/doc/current/lib/node241.html <7> genia4_ yep, that's one of its uses <24> rtfming :) <25> univac: something like: <25> re.search(r"(\s|^)(https?://\S*)(\s+|$)", "x https://adsasd x").group(2) <25> (also supports https) <24> I guess I should be specifying the stdout parameter, correct? <18> univac: a.split()[1] ? :) <6> sapo, uh huh, it doesn't do much good if you don't understand it enough to modify, though <22> no, it's ranodm place of link. <6> sapo, can try to explain if you've got any specific questions <18> [x for x in a.split() if x.startswith('http')][0] :) <23> wundo: hmm I don't know <0> genia4_: yes, if not specified the stdout goes to "console" <22> Erwin: stain thanks. :) <25> maybe r"(\s|^)(https?://\S*)" is a bit simpler - nothing or space before <26> I hope it's not too terrible that I have little knowledge about Qt <27> I get the wrong answer: >>> e ** log(5, e) == 5 # returns False <25> note that for instance if I say "http://asdkjaskdjaskdj, that's a nice place" then , will be included <28> Well sure <28> It's floats <25> Jonex: it's because it is not precisely equal <28> >>> math.e ** math.log(5,math.e) <28> 4.9999999999999991 <25> the closes approximation calculated by your fantastic floating point processor is of by a small bit <27> Yeah, I noticed that. But, shouldn't it compensate for that in some way? <28> How? Magic? <27> I mean, if I were using the interpreter as a calculator, it'd be quite vital that it gets me the right answer. <23> Brend: it's useless to specify math.e as the log base <23> it's the default one <18> when floating point involved, you usually never want to use == <18> but rather compare that the two numbers are within a certain distance <28> loufoque, I don't know why you're telling _me_ that <27> loufoque: I wrote with e <25> Jonex: but it's not equal using the approximation techniques used by your CPU. <25> Maybe what you need is a symbolic processor like Maple.. but even in Maple you could get floating points <27> stain: But I don't get it, "e ** log(5, e)" should return 5 shouldn't it, no approximation required. <29> hey! <29> my e is wrong! <25> Jonex: how do you think this thing is calculated? <23> stain: maple is evil proprietary software <25> log(5) is 1.6094379124341003 <25> maybe in reality it is 1.609437912434100312378612837812893781273781263812763182 3 12u83y1782361872631872637812637812637812636182736 <29> e = 2.7182818284590451 it says <25> but you cannot have infinite precission right <25> so at some point you stop <29> it should be ...452! <27> stain: so python shouldn't really be used for math then? <23> log(5) is log(5)
Return to
#python or Go to some related
logs:
dhcpcd start gentoo tightvnc kdestart takxi movie libccgnu2 ubuntu #fedora #qemu #web #linux installing gbtcr #kde
|
|