| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Comments:
<0> oh god <1> except ...: <0> i even know that <0> :/ <0> i just shouldn't be coding right now <0> thanks <2> hey, exist a usleep in python? <2> for count milisecs? <3> Condector: time.sleep accepts a float <2> joedj, hey, the python cookbook exist in web?? online?? okay, i'm try find again!! <2> joedj, thanks again, ahuhuha, sleep NOW is perfect!!! <3> Condector: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66012 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 <2> joedj, thanks again man!! <3> Condector: no worries <2> good night people <2> 04:40 here
<2> hehehee <2> seeya <4> 2:39am here <2> sysfault, Brazil? <4> US <2> sysfault, humm, okay <5> CHodapp: did you use the ImageMath module to create those images? <6> what's needed to use python as cgi scripts with apache-1.3? do i need mod-python or something? <7> No. <6> why not? <6> it works <7> That's not much of an endorsement. <6> let me put it other way: why should i learn apache2 if i can use apche-1 and it works for me? <8> Microsoft: Why Not? It Works*(TM) <6> it doesn't work for me <6> :) <8> Hence, Works* <8> read the fine print <6> heh <6> individual results may vary? <9> is there a way to print color to the terminal screen? <6> http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html <7> curses <9> how can i print the esc character? <7> Using raw codes is the wrong answer. <6> why? <9> this is a simple little script for me and i just need some color <6> our> how can i print the esc character? <6> oops <6> >>> print "\033[34m" <6> works fine <6> makes foreground blue <7> On terminals that have that as the foreground color change code, sure. <6> well, of course terminal should support it <6> but if you want something working you'd need to work with termcap or terminfo, or use curses or something <9> is there a way to reset? <6> and that's overkill <6> outpour: first item in the list <9> [0m nvm <9> awesome exactly what i need thanks <6> ignacio: it's overkill because those ansi codes work in xterm and friends, and work in linux console, and the guy probably doesn't need anything else, and it's much cheaper than making truly portable' <6> thing <6> and then, everything is buggy, so you can't achieve real 100% working thing anyway <7> Riiight... <6> you know, "works for me" thing :) <7> You were doing fine until you said "everything is buggy"... <6> terminals are buggy, they claim to support something and actually do not; distros are buggy and set wrong TERM variable; users are buggy and mess with their setup; etc. <10> hi! how can i break nested for loops? should i use exception? <10> or if-break in each nested loop? <11> Drekin, both work. both are ugly. <10> u know any nicer solution? <11> reorganization of code, if possible, and it usually is. <12> hey i need to extra the arguments of a command that's stored in a string and p*** them to execpl, how would i do that? <11> but if I had to choose from those two, I'd pick exceptions <10> i thing i cant reorganize it, its ascii converter so i on every 8*8 px of image i use 256 chars * 16 foreground colors * 16 backgroundcolors <10> and if i raise StopIteration and catch it won't be so ugly, will be? <13> i'm trying to toss in a line at the end of a python script which runs a shell command, so i try things like print os.popen( '/bin/sh thing' ).read(), thinking it'll run the operation and give me the output, but it does nothing. <13> the script is not in the same directory i'm executing it in. <13> but i just verified that that doesn't matter.
<14> cmd = commands.getoutput('who') <14> print cmd <12> how do i remoev the first element in a list? <14> cmd = "uptime" <14> os.system(cmd) <14> djef: two diffrent ways there ^^ <11> Drekin, StopIteration has a well-defined meaning and this isn't it, define your own exception cl*** <13> what library is commands in? <14> import os, commands <10> sean_micken: del yourlist[0] <13> the 2nd method doesn't ever work for me. it works for simple things like "ls" or "who" but not "/bin/sh ..." <13> yeah, both methods seem to fail. <10> Juhaz: ok, thx <14> djef: i used those in a sysinfo script http://legacy.subliminal-hate.org/sysinfo.py i never finished it but maybe you see somehting useful <13> tty: thanks, i'll check it out. <13> very interesting. if i use a shell scirpt to do nothing more than run my python script, then those two methods both work. <13> perhaps there's something about the shell environment or user settings that needs to get set? <14> djef: i would bet a path issue would have to play a bit though <14> good luck i gotta sleep <13> thanks. <15> hi, can i split a string on multiplous separators in one time only? <11> HazyNRG, not with str.split <15> ok, so i have to code my own func? <16> does anyone know what I have messed up here? http://deadbeefbabe.org/paste/2860 <17> hey, I've got what seems like it should be an easy question, but having trouble finding the answer online: <17> how do I create a tuple with a certain size <17> ie, I basically want to create one containing a bunch of zeros <11> HazyNRG, there is re.split that can split by regex <6> PigZelner: you don't call parent's __init__? <15> Juhaz: yeah, thanks :) <16> muntyan: ah <16> muntyan: where should I do that ? <15> p*** one instance to two.__init__ <16> hmm, could you edit the code snippet? <6> http://deadbeefbabe.org/paste/2860 <16> muntyan: it loops a bit, and says "RuntimeError: maximum recursion depth exceeded" <17> aha, I've got it :) <6> PigZelner: oh, you create an instance of cl*** two in one's __init__? <16> muntyan: yeah. maybe I should not do that ? <15> will http://deadbeefbabe.org/paste/2861 work? <6> PigZelner: maybe <6> PigZelner: what's the point of that? <6> or rather what's the point in making two subcl*** of one <18> PigZelner: eh, <18> PigZelner: you have a cl*** that keeps instantiating itself <18> PigZelner: so you end up making an infinite number of instances (until Python stops you because it thinks something is wrong.) <18> HazyNRG: no, that will not work (and doesn't do the same thing, anyway.) <16> Yhg1s: hmm <18> PigZelner: the reason 'print self.g' doesn't work, by thew way, is that it's never reached. <16> Yhg1s: ah, how could I reach it ? <18> well, here's what happens. <18> you create a one() instance, <18> its __init__ is run. It does 'self.kl*** = two()', so you create a two instance. <15> ha yes, sry <18> two.__init__ is run. It calls one.__init__, which sets 'self.kl*** = two()', so ou create another two instance, <18> et cetera, ad nauseam. <19> yay for closures <18> PigZelner: you're making an infinite chain of 'two' instances, all glued together. <18> PigZelner: until it crashes because Python doesn't want to recurse so deeply (in functions) <16> Yhg1s: hmm, right <16> ok, I have reverted the code snippet back. the main problem is how I can get the variable 'g' into the cl*** 'two' <16> my plans was that 'one' managed the balls flying around on the screen, and 'two' represents a ball <6> you should call parent's __init__. but in your case it's impossible. so the question is "why is two subcl*** of one?" <15> http://deadbeefbabe.org/paste/2861 <6> PigZelner: why is ball subcl*** of ball manager? <18> PigZelner: that sounds like one and two shouldn't be subcl***es. <18> PigZelner: you should also realize that 'one' refers to the *cl****, not any specific instance of the 'one' cl***. Since you made 'k' a cl*** attribute, 'one.k' works, but one.g is an instance attribute, so you need an instance of 'one' to get to it. <16> muntyan: I thought I had to do that to get variables from the 'one' cl*** to the 'two' cl*** without p***ing too many variables over <16> to 'two' <16> Yhg1s: ok <16> anyways, thanks for all help! <20> hi folks. <21> Gack! Doctest doesn't use a memo, cycles put it into an infinite loop :(
Return to
#python or Go to some related
logs:
debian kernelpath gz_encode netbase + ubuntu + reconfigure #ati unrar -l #css #openzaurus #php open-chm ubuntu #ubuntu
|
|