| |
| |
| |
|
Page: 1 2
Comments:
<0> ok <0> this is killing me <0> http://pastebin.com/719560 <0> what in the world is wrong with that? <0> i telnet to the port, type something in <0> doesnt print received: <1> asyncore, I have no clue <0> ugh <2> did you mean to use blocking I/O? <2> you're blocking on your reads, it won't do anything until it exhausts the stream <0> ok yeah becuase now im getting a Resource Temporarily Unavailable <0> so how should this be implemented? <2> don't use a while loop in handle_read <0> just data = self.recv() ? <2> handle_read means "there is data available for reading" <2> just call it once
<2> yes <2> if there's more asyncore will call handle_read again <2> the whole point of asyncore is it handles this stuff for you <0> ok i need to make sure that ive read everything however. <0> i basically need to read evertythign until the connection is closed by the client <2> then accumulate it and process it in handle_close <0> hmm ok <0> http://pastebin.com/719609 <0> xihr: this doesnt seem to work either <0> TypeError:recv() takes exactly 2 arguments (1 given) <0> ahh ok <0> hmmm <0> documentation on asyncore is poor <2> recv takes an argument just like the C API call <0> yeah was used to java thinking youy could call it with nothing and it would read all available <3> Heya, Can somebody help? I am trying to convert a str to an integer. The str I am converting is a number and so tried: int(str). This, however, results in an exception: ValueError: invalid literal for int(). Thanks. <2> that means, like the error says, that the string is not a valid literal <2> int('asdf') will give that exception <4> eric_: also e.g. int('3.145') will throw that <4> so perhaps you're doing that? <3> Here is some of the data that I printed out to see what I have: <3> |1| == |1| is False <3> <type 'int'> <3> <type 'str'> <3> |2| == |1| is False <3> <type 'int'> <3> <type 'str'> <3> I put pipes infront and after the numbers to see if I have any spaces there. <3> But since the pipes are right on the numbers, there are no spaces. <2> no idea what that's supposed to mean <2> are you saying you're trying:: 1 == '1'? <2> of course that's false; they're different tyes <2> types* <3> Yes, but when I add int() to convert that str into int, I get that exception. <2> well vertical bars aren't integer literals, so obviously that's not going to work <2> int('1') == 1 <2> int('|1|') is an exception <3> Pipes are there only during printing. <2> well you're running code we can't see so it's impossible to tell you where you're going wrong <2> showing us the output does nothing but confuse us <3> I put them there to see if there were any spaces around the numbers. <3> http://rafb.net/paste/results/xQqS5L96.html <2> what is that supposed to demonstrate <2> if you're getting that exception there, then the problem is int(parsed_data[1]) <2> what that function prints when it's working doesn't really tell you anything, you're interested in what the value of pased_data[1] is when it DOESN'T work <3> Yes, that is where it throws the exception. But I don't understand why since the result of parsed_data[1] is '1' <2> which doesn't print anything because it throws <2> you're not printing parsed_data[1] anywhere there, how do you know that? <2> the whole point is: it isn't what you think it is <2> put a print statement BEFORE it <3> I printed parsed_data[1] and that is how I know. <2> well then you're doing something else wrong <2> you're not giving enough information to be able to help <2> int('1') == 1, you can type it in your interpreter to test it <2> so you're confused about something <3> Yes, I am. :) That is why I came here. LOL. <2> you still haven't shown us a traceback and exact error <2> for all I know you're looking at the wrong line <2> if the exception is from that line, then before it write:: print `parsed_data[i]` <2> then you'll see what it really is <3> I did that and got 1 of type str. But ok, I will erase the function and write again. Maybe that will help. :) Thanks.
<2> you're showing a tiny snippet of code without context, no traceback or exact error, there's not much anyone can do to help at this point <3> xihr, sorry about that... I've put the relevant code here with results and traceback. <3> http://rafb.net/paste/results/ZUmaUP76.html <3> I found it.... the very first character in my source file was some strange character. After I deleted that, it works! Thanks xihr. <2> no problem <2> when you're seeing something that "can't happen" like that it's always something you just don't suspect <3> Yes... And, that strange character was at the beginning of every line, too. Just glad I got it now. I spent two hours on it yesterday and another 1 today. <3> Now, I will not only suspect my code by also the source. hehehehehe <2> heh <2> especially with dynamic languages like Python, you really need to check your ***umptions when you're stuck <2> check things you KNOW can't be the problem, work backward ... <4> xihr: Python doesn't do tail recursion optimisation? <4> or rather, Does python do <4> ok madewokhe, thanks <2> heh <1> I think it's so you can still get a traceback <4> are there any plans, or does no one care, or..? <4> ahh <1> that's a guess <2> nah, it's just because it hasn't been considered a priority <2> well tracebacks still have uses in languages which DO have tail recursion optimization ... :-) <4> right.. <5> ello <6> i'm installing flup. would it be better to create a distro package for it or to install the flup python egg? <6> no one ever knows anything about python eggs <6> lol <2> nope <6> xihr: i know... i find that funny <2> it's not widely used <6> or were you being sarcastic? <6> ok <6> yeah <0> re xihr <7> yo <4> xihr`: how's the new kitty? <4> getting along with the older one? <7> yeah, quite well actually <7> he's sitting on my desk at the moment, just woke up <4> hehe <4> older one isn't jealous at all? <7> tried his best to choke on something today <4> haha <7> nah it's pretty obvious she's crazy about him actually <7> plays with him, sits two feet from while he plays with toys <4> hehe <7> the kitten doesn't know when to quit so it gets pretty rough at times but they're getting along great so far <4> hahah <7> really well-behaved kitten, I'm very pleased <4> what breed is he? <7> mutt <4> hah <2> he's a stray, I don't know what his mother looked like <2> all my cats have always been mutts <4> oh picked up from shelter? <2> no, a friend's kid found him <4> oh <5> anyone familiar with spyce? <4> deja vu? <4> or was it someone else who asked about this earlier <4> (to answer your qeustion, not me) <5> wasn't paying attention if someone did, sorry <5> anyone familiar with spyce? <5> sorry, couldn't resist <2> heh <2> yeah someone else was just asking about it <5> I wish there was a channel to talk about it, but apparently no such channel exists <2> feeling bad? <5> well, i've had some sort of throat illness.. gunk all up in there.. and now it's a little sore <2> nasty <5> this morning I thought I was going to die... whatever I ate at the mexican place the night before wasn't good to me <5> nor my gf <5> stomach cramps from hell
Return to
#python or Go to some related
logs:
#computers #winvista jjkjkjkj
fuck pastrami
#politics #beginner #firebird hederophobic
#unixhelp #worldcup
|
|