| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Comments:
<0> kbrooks, right.. <0> thats a list <1> CLucas916_x64, because you are incrementing match in your for item in files loop <2> vIkSiT main() has its own scope like any other function. <1> CLucas916_x64, if there aren't any items in that list it wont' enter the loop, so matches won't be incremented, so it'll stay 0 <3> polpak, heres what i tried http://pastebin.com/725476 <0> Zalamander, yes, i realized that. I'm going to use a cl*** for this anyway, since I want to make the application extensible later on <1> CLucas916_x64, put match outside the loop <4> How do I do mylib="time" ; import mylib ? I tried import eval('mylib') and a few others... <1> CLucas916_x64, (up 2 lines) <5> ccd: __import__(mylib) will return the object <6> time = __import__('time') <3> polpak, done now what <1> CLucas916_x64, remove the if files != []: <5> so you could do locals[mylib] = __import__(mylib) <1> CLucas916_x64, move match += 1 down 2 lines
<5> or mylibimported = __import__(mylib) <3> polpak, move match += into the for loop? <4> lemme chew on that for a sec <4> thanks <1> CLucas916_x64, then unindent the if match != 0: and the block for it back outside the loops <1> CLucas916_x64, yes <3> k lets try this <3> im getting a syntax error at the beginning of match += 1 <7> hi. retarded question #2 (I left my python book at home and google isn't helping) <1> CLucas916_x64, what's the code look like? <8> zenspider: ask. <3> http://pastebin.com/725490 <8> zenspider: don't announce. just ask. <3> polpak, oops <7> trying to write failUnlessRaises(BlahException, lambda: obj.setter = 42) and it is bitching about the lambda. I KNOW I'm doing something obvious, but google isn't clarifying <3> polpak, nvm dumb mistake <6> zenspider: lambdas can only contain expressions, not statements. ***ignment is a statement <7> clue me in on what is wrong with the lambda? I ***ume it is something implicitly wrong about expressions <7> joedj: is there a way to fake it? I simply want to run some bad code and test that it raises properly <6> zenspider: use a named def on the preceding line instead of a lambda <0> Ok, this is a problem i'm facing when rendering something using tkinter. I have a function called renderparticles and the other is the root.mainloop(), for Tkinter <0> the problem is - if i call the mainloop before renderparticles, the particles don't show up on screen <0> however.. <6> zenspider: or raise the exception a different way, like 1/0 =P <9> zenspider: setattr(obj,'setter',42) <0> if i call the function renderparticles before the mainloop, it does the animation and i only get to see the last frame when the mainloop starts <3> polpak, so the output now is repeating the list of files a bunch of times and is still giving the error <0> question - how would i get the two to launch simultaneously? <1> CLucas916_x64, show me the code again? <7> Ceran: that byp***es my setter code, doesn't it? <7> joedj: I hate to do it, but I think I'm stuck with my unit test having a try/catch block <9> zenspider: I don't know. I haven't tried it. <3> polpak, http://pastebin.com/725490 <7> Ceran: ah... but you'll give it as advice... nice. <0> Zalamander, around for a bit? <9> zenspider: You didn't say you had properities set for the attribute. It's not that hard to test yourself, and it's not my code. <6> zenspider: setattr shouldn't byp*** anything <1> CLucas916_x64, 2 problems <1> CLucas916_x64, one is that you're incrementing match in 2 places <3> i thought i fixed that <3> refresh <3> its only in line 9 now <1> CLucas916_x64, that's right <3> ok <1> CLucas916_x64, now only one problem <1> if match != 0: <3> polpak, it should be match == 0 <1> CLucas916_x64, yes it should <3> whew we survived <7> oh, right... but we can put the def in the test def so it isn't too terrible. cool. that works for us. tnx <0> ouch <3> polpak, ok sweet, no more error <0> btw - is there an equivalent of the C++ /* */ comments in python? <3> now i need to figure out why the list of file names keeps repeating <0> I know of # and """ .. but ? <9> vIkSiT: That's it. <0> ah ok <3> polpak, nvm fixed it, its all good now <3> thanks a ton <9> vIkSiT: Although the """/''' are technically strings, not comments. <0> yeah
<0> But unless I write a regexp to insert #s in vim .. :) <1> CLucas916_x64, =) <6> vIkSiT: surely vim has some kinda block comment function... <10> how do you read/write from/to a process's memory? <0> probably.. <1> jackyyll-, ? <10> polpak: how do you read/write from a processes memory? <11> jackyyll-: never could find a way in python, odds are you'll have to do that in C then wrap it <1> jackyyll-, I see the question.. it's not terribly descriptive <10> polpak: like say i wanted to check the value of 0x123456 <1> jackyyll-, eww <6> jackyyll-: write a C module =P <10> gah lol <1> jackyyll-, why would you want to? <8> whoa! <10> woah <0> joedj, yeah there is. NERD_comments.vim <8> that was so fast <10> server split? <1> rejoined <8> came in without me noticing it <10> hmm does anyone know of a c module for memory? :P <11> polpak: reading memory is usually needed when you're doing addons for programs that aren't intended to be modified <6> jackyyll-: there was one a while ago by PenguinOfDoom - shootfoot.c <10> is it on the python forums? <6> no clue <10> oh lol <10> haha <10> 'no ell oh ell zone' <4> mylib="exec_parse_www.sharebuilder.com_transactionhistory" ; __import__(mylib) gives me "No module named exec_parse_www.sharebuilder.com_transactionhistory" , the file exec_parse_www.sharebuilder.com_transactionhistory.py resides in a folder in my $PYTHONPATH that I use for all my modules... what am I missing? <10> does anyone have a memory module? :/ <12> ccd: err, a "." in the module name? That probably isn't going to work. <13> why the hell do you think you want to do that? <4> marienz : aah. oops. thanks! <13> I have a module i use like foobar.com where foobar is a package that just contains a com package, if you want something like that. <14> Another question. I am looking at decimal right now to work with real numbers that are larger than the ones float support. But what I wanted to do is to do e^x where x is quite large. My problem, seems, is that the exp function in Python does not work with Decimal types, or at least it is still giving me errors. Any recommendation on how to overcome this problem? <10> ironfroggy: was that ment for me? <13> elventear: use the ** operator <13> jackyyll-: yes <6> jackyyll-, ironfroggy: no, i think it was for ccd <14> Okay. And define an approximation to e? <14> ironfroggy: So I should ***ume that Decimal and numpy do not play well? <10> ironfroggy: what exactly does it do? <13> jackyyll-: the "why the hell do you think you want to do that" was meant for you. <10> okay im confused lol <13> elventear: i dont know. what makes you think so? <6> ironfroggy: that one coulda gone either way =P <13> jackyyll-: why do you want this "memory module"? <10> ironfroggy: so i can read/write to a processes memory <13> joedj: hey! like i said, i do what ccd is trying to do. <14> ironfroggy: Pessimism :-) <13> jackyyll-: WHY <10> game trainer <13> jackyyll-: what in the memory do you want to work with? <10> ironfroggy: just memory addresses and values, like reading the value of 0x123456 <10> ironfroggy: or writing and changing the value of it <14> ironfroggy: I just checked. It seems to work ... The clever gentleman in numpy included a datatype for a generic python object <14> :) <13> jackyyll-: what OS? <10> windows <13> are you trying to wallhack?! <10> hahaha no <10> i said game trainer not hack :p <15> other than iterating and summing manually is there a way to get the sum of all elements in a list given by another list of indices? <15> so if if I have a = [0, 2] and b = [1,2,3,4,5] I want sum of element 0 and 2 in b which is 4 <6> not really, there's sum() <6> sum(b[i] for i in a) <15> joedj: ah that'll work, thanks <11> decimal.Decimal("10")**decimal.Decimal("100000000000") <11> InvalidOperation: x ** INF <11> heh <1> jackyyll-, doesn't the OS prevent you from just randomly reading/writing on another processes memory? <13> polpak: its windows! <10> polpak: what froggy said :p
Return to
#python or Go to some related
logs:
xmms aac ebuild tmwserv conky config file skype read error, res = -1 , handle = 22 read error, res = -1 , handle = 22 read ifconfig eth del rpm conver, alien, linux #php #python printer-service-error, red hat
#web
|
|