| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Comments:
<0> Gack! Doctest doesn't use a memo, cycles put it into an infinite loop :( <0> 0 of 0 examples failed in __main__.FixedPoint.InexactFixedPoint.FixedPoint.InexactFixedPoint.FixedPoint.InexactFixedPoint.FixedPoint.__doc__ <0> oh, fixed in 2.4 :) <1> I did make test to compile gpodder.. and got the following error ... File "./src/gpodder/libgpodder.py", line 16, in ?..... from xml.sax.saxutils import DefaultHandler......ImportError: cannot import name DefaultHandler....make: *** [test] Error 1 <2> I have a string that contains a number, but it has like 10 decimals and I want to convert it to a a normal float, how do I do that? <3> float(string) <2> and then I can round that float with %g? <3> sure <4> hi all <5> hola <6> http://spamusement.com/index.php/comics/view/234 <7> http://pastebin.com/549653 is a simple script that processes a registration form. the problem is that it keeps sayignt hat p***words don't match even if they do. cans omebody take a look? <8> hola <9> crplay: and what does "print repr(form['pwd']), repr(form['pwd2'])" printC[C[C <9> eh, 'print?' <7> prints the same
<7> Yhg1s: but i got it now. form['pwd'].value works <7> Yhg1s: don't understand what was wrong earlier though. <10> crplay - well, in the paste, you're comparing the objects for p***word correctness, not the value attributes <7> prencher: in case of a dictionary, is it not perfectly valid to compare dict['a'] and dict['b'] ? <10> crplay - sure, but those two were refering to two different objects, each representing a form field, and you wanted to check the value they contained, which are stored in the value attribute of said objects <10> you were checking if the fields were equal, not the values <7> oh okay <11> is it hard to write a python program to make a complete dir structure and file size list of given drives? <10> davix - thats quite easy.. have a look at the os module, and os.path <11> will do, thanks <10> os.walk and os.path.walk in particular should be useful <11> oh <11> how do I know to look at those mods by myself <11> and not asking here? <10> %g python os module <10> hm, didnt there use to be some bot in here responding to that?, but.. http://docs.python.org/lib/module-os.html davix <11> thanks <10> remember you can also use pydoc foo, or import X; help(X) in the interpreter <11> lovely <11> wow <11> this is neat! <11> :D <11> doesn't IDLE have autocompletion? <11> nor colorizing in it's editor <5> I never did like IDLE <5> just wasn't comfy <10> prefer simple editors myself.. like editplus on windows and gedit on *nix <10> as long as it got syntax highlighting <11> i will want on the fly interpeter <10> you can always do that through python itself <5> I use vim.. I have code folding, syntax highlighting, auto completion, pylint integration, inline python help... everything I need <10> just import your given module, and do stuff to it :) <11> right. <10> for fast prototyping, you can just reload() the module, while having the interpreter running and hacking on the module in the editor, while trying various things in the interpreter <10> combined with pdb (python debugger), you got a real nice environment right there :) <5> yeah, I use the command line occasionally <10> personally im finding i very rarely have to crank out a debugger for python, in fact i can only remember doing it once.. and that could've been avoided with unittests <5> what are unit tests? <5> ***ertions? <10> pydoc unittest :) <5> oh bah <10> but yeah basically <5> yeah, I looked at it <5> ***ertions <5> I normally just get it right on the first try ;) <5> *yeah right* <10> speedie - oh me too, but then you make a change to the interface later and it breaks in weird ways ;) <5> I normally do it the ghetto fabulous way, and use a bunch of prints, and when that fails, I use winpdb <5> I used to use eclipse with pydev <5> that is one helluva python setup <12> i prefer ghetto fab debugging too <5> but man, eclipse is such a beast <10> its a bastard to setup <10> but it does seem pretty sweet nowadays <5> eclipse? <12> leave tons of hooks and dead functions <10> yeah <5> how so? <5> You just unzip it <10> you have to configure lots and lots of stuff before pydev actually works for debugging and such <5> and to install pydev, you just use the Eclipse Plugin Manager
<10> stuff not at all obvious unless you're familar with eclipse <5> prencher: not in the more recent releases of PyDev <5> but yeah, up until like October/November, I'd agree with you <10> speedie - i actually got it less than a week ago to give it a try, and it just wouldnt get a release/debug run mode setup <5> The recent releases have come a long way in making it a user friendly experience <5> Thats odd :) <5> of course, I was experienced with eclipse/java the first time I tried it <5> the first thing I did when I installed a python interp was go searching for eclipse plugins <5> I just switched to vim because now days I really don't do any python programming... I mostly do ObjC, but I sit in this channel, and when I see questions, I try to bang out little scripts to see if I can help <5> helps me to not forget python <5> but eclipse was far too bulky for that <10> oh you can try out pythonwin btw davix .. it's got syntax highligting and autocompletion and all that <5> pythonwin is actually nice <5> I use a mac now, so I can't do pythonwin anymore either <11> yep, i'm now installing it, a friend recomended <11> activestate's activepython <5> but, eclipse was the only thing I found that could cleanly handle things like PyGame <5> IDLE, Pythonwin, they all crash when the program exits <5> I hear the same is true of almost any gui toolkit <5> but i've never used a gui toolkit... as I say, most of my python scripts are just hacks to see if something works <10> davix - its got an interpreter as well.. and i believe debugging <11> it should be good for a start then <5> anything's better than idle :) <10> yeah does indeed have a debugger <13> anyone's up for a asynchat problem? <14> ask away <13> i have a connection handler using asynchat. When "sending" a message using push(), in winXP one message is sent over the net, but two in win2000. Feels like a threading problem of some sort.. <13> that is, the message is sent two times in direct sequence in win2000. <13> the push() method is of course only invoked once in both scenarios. <15> Asyncore isnt threaded <16> is there a python programmer with spare time and will to work with me on a project? <13> well, usign asyncore.dispatcher for the initial connection handling, but feeding each accepted connection to a handler using aynchat. Each such handler ought to be given a thread of its own? <17> i have 400 px width and 300 px height form. i have some widgets when i pack them i see them center of form. i want to see them aligned to left of the form <17> i tried anchor <17> it didnt work for me <17> i tried to use grids it didnt work again <18> what view do you guys have on complete python newbies asking questions? It's a simple one, but I haven't been able to fix it after two hours of googling. <14> nev: go for it <18> cool :) <19> Nev|Newbie: most chans are of the attitude "rtfm first, if you still got Q's, go for it" :) /me can't explicitly comment on #python, not been here long enuf... <18> basically, I just want to remove the line that starts with ENDDKPLIST in dkp_list.LUA :) it also happens to be the last line in the file <19> python != lua <18> so I need to open the file, remove that line, and save it.. somehow <18> yeah, I know. but lua is just plain text <19> um.. lua's a programming language :) <18> well yeah, but it's a plain text file :) <14> so do you have something (yet) which reads all the lines from the file? <18> yeah, I think so <18> I tried several methods =) <18> fh = open('C:\Program Files\World of Warcraft\Interface\AddOns\GetDKP\dkp_list.LUA') <18> >>> for line in fh.readlines(): <18> if line.startswith("ENDDKPLIST"): <18> something like that? <14> yes, that's a start <14> does that successfully print out the line you want to remove? <18> how do I check that? :) <18> (I only downloaded python two hours ago and I haven't slept much, so, well.. I ****) <14> after if line.startswith("ENDDKPLIST"): add the statement "print line" <18> oh right <18> yep <18> prints the correct line <14> okay <14> so now, reverse it so that you print out all the lines that you actually want to keep-- something like "if not line.startswith(stuff): print line" <18> ah <18> *does that* <18> done <14> then, if you want to write the result to a file instead of printing it out, you'll need to use open() or file() to open a file in writing mode, then say outfile.write(line) instead of print(line) <18> right.. how do I open in write mode? :) <14> open("filename", "w") <13> mcmillen: is python using native threading, or is python handling threading itself by brokering one thread itself? <20> file("file/path" "w") <16> I repeat: is there a python programmer with spare time and will to work with me on a project? <20> and "r+" for read/write mode
Return to
#python or Go to some related
logs:
tuntap etch fix broken avi ubuntu ubuntu Double-buffered visual d2gs 1.11 #ubuntu #debian #ai xubuntu starmax #mysql Subroutine redefined at perl
|
|