| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Comments:
<0> command line? <1> yes <1> python testwebserver4.py <1> tried python -d testwebserver4.py also <2> I really doubt you want that <0> im doubting do_POST is ever even called <1> it is <0> how do you know? <1> I have a debug line above what I posted saying print "POST" <1> and it always gets executed <2> where is your latest code? <1> gimme 10s <0> is the request handled? <1> http://pastebin.com/752953 <1> ironfroggy: what do you mean? POST gets printed so I ***ume so <2> for a start, take the [0] out
<2> for a second, make it fp=self.rfile <1> ok <0> do you get anything in the browser when you test it? <3> is there a function similar to BASIC asc() <0> sanmarcos: remind me what it did. <3> get the ascii code of a character <2> sanmarcos: ord <3> thanks <4> case ={'a':a.data, 'b':b.data, 'c':c.data, 'd':d.data} , i wanna do this for all 26 chars,, how can i do that? <4> without typing all that.. <3> I am basically trying to code something that goes from a-z to 1-26 using re <3> i got my table already dict((c,m + 1) for m,c in enumerate(string.lowercase)) <5> sanmarcos: 1-26? not 0-9 ? <3> no, for a 1, for b 2, and so on, need to replace a long string with a numeric value given by the dict I posted above <2> PerceptualChaos: go back... forget about cgi again... what is in self.rfile? <5> oooh,I see. <5> sorry. <3> I was just wondering if there was an easier way to do it, but apparently not <1> http://pastebin.com/752961 <3> I could do for x in buffer: ord(x) - 96, or 64 depending on the case of the letter <2> ((chr(x),x-ord('a')+1) for x in range(ord('a'),ord('z'))) <2> PerceptualChaos: and what is in fp? <3> hmm, ill go back to my dict <0> sanmarcos: why would you want to do this anyway? <4> sanmarcos: how do you access your table after making them using ur code? <3> ironfroggy: one time pad <4> sanmarcos: i'm not understanding your code <0> sanmarcos: huh? <3> ironfroggy: http://en.wikipedia.org/wiki/One-time_pad <4> onetime padd crypto <3> ironfroggy: just doing some concepts <4> ahm..... <1> Leeds: print fp => <socket._fileobject object at 0x009D8F48> <4> ok i got enumerate(string.lowercase) part, what does dict((c,m+1).. do? <3> switches the order and makes it start from 1 <4> yes i see that , but what is dict((.. <2> PerceptualChaos: yes, and what is *in* that file? <3> eugenekim15: it creates a dict from that loop <4> i'm trying dict(('a',0)).. but gives me error <3> dict((c,m) for m,c in enumerate(string.lowercase)) <4> sanmarcos: i guess that's what u do, but how? and how do u access the dicts? <2> eugenekim15: try dict((('a',0),)) <0> sanmarcos: i dont see how that requires that A be 0 <3> ironfroggy: I know <0> sanmarcos: it would work no matter what numbers were ***ociated with each letter, as long as both sides agreed. <4> Leeds: oh cool, then how do i access it? <3> ironfroggy: I am just using this for something that will become useful later <4> Leeds: what's the name of the dict i created? <2> eugenekim15: well... then it's a dict <0> eugenekim15: how can you not know the name of it? <0> eugenekim15: this is an important question. <4> ironfroggy: dict((('a',0),)) i never seen this structure.. normally we use = to ***ign a new value/name pair <4> ... <0> eugenekim15: that is never changed. nothing is being ***igned there. <0> eugenekim15: that is an expression, not a statement. <4> ironfroggy: oh... ahaha cool <2> PerceptualChaos: print fp.read() <1> Leeds: print fp.readline() hangs my browser (firefox says "loading...") then when I stop it prematurely I get "user=timothy" <1> or fp.read() <2> PerceptualChaos: or better, in my opinion, file("/tmp/foo","w"),write(fp.read()) <1> user is the name of the textbox
<1> and timothy is what I entered <4> for c in string.lowercase: <4> c = 1 <4> .. i can't do that.. <4> sanmarcos: did u ***ign names to ur dicts? <3> eugenekim15: huh? <4> case ={'a':a.data, 'b':b.data, 'c':c.data, 'd':d.data} , i wanna do this for all 26 chars,, how can i do that? <4> remember this was my original question.. <4> sanmarcos: i'm wondering if you have ***igned name to each dict? <1> so I think its having trouble reading rin for some reason <3> eugenekim15: each dict? what does it matter?, yes I ***igned a name to my dict <3> eugenekim15: if you dont understand list comprehensions, I suggest you checkout Dive into Python <4> sanmarcos: can you show me how? did you ***ign names in a loop? <4> sanmarcos: no i understand it.. <1> I'll try do a send_response(200) *before* reading rin <3> eugenekim15: names to what? <4> sanmarcos: i was not getting dict(((,) part not the list compression <3> eugenekim15: dict((c,m + 1) for m,c in enumerate(string.lowercase)) <1> same thing happened <3> see c,m ? its the for m,c line, its switching it, and for m, its adding 1 <4> sanmarcos: oh, i see, you have only 1 dict, not several.. <1> maybe smashing my computer will help? <1> :-/ <3> hmm why would I get something like TypeError: len() of unsized object when trying to len() a multi line """ string? <6> sanmarcos, probably because you're len'ing something else. <2> PerceptualChaos: did you do what I suggested? write the stuff out to a file, rather than trying to 'print' it to the network? <1> I was printing to the console <1> but yeah I'll try it <1> kieranDOA: I read that link you posted but the difference here is that I'm trying to use the cgi function from a do_POST routine in a BaseHTTPRequestHandler cl*** <2> PerceptualChaos: frankly, go tell your teacher - from me - that requiring you to use BaseHTTPServer is dumb <1> sure :) <3> so, it wasnt that hard, I have alphamap = dict((c,m + 1) for m,c in enumerate(string.lowercase)); for l in alphamap.keys(): text = text.replace(l, str(alphamap[l])) <3> thanks for the help <1> Leeds: I tried: file("C:\temp\fp.txt","w"),write(fp.read()) <1> but it didn't execute <1> ? <2> did it create the file at all? is it hanging on the read() <1> it didn't create a file and its not hanging the browser, it just crashed <1> syntax error? <2> crashed? with no error message? <1> I don't get error messages <1> it didn't execute the print string message after it <2> but the server is still running? <1> yes, it just exited the do_POST function <2> but it didn't complete that function <1> yes <1> yes meaning you are correct, not yes it did complete the function <2> so it's hanging on the fp.read()? <1> well its not hanging the browser like it was when I used print fp.read() but it is exiting the function prematurely on that line <1> which to me is indicative of some sort of syntax error <1> not that I know <1> :D <2> that's what I'm trying to ask - is it exiting the function, or is it just getting stuck? <1> I expected it to hang the browser though like it did for the print statement <1> its exiting the function <2> how do you know? <1> because my browser brings up an empty page and calls a get on that faveimage thing <1> *GET <1> when I was using print fp.read() iit was getting stuck then it would exit the function when I clicked stop button on browser <7> Hi all ! Is someone help me with PyObjC ? <3> ShubNiggurath: try #macdev <2> hmm... someone is using tabs... <1> tabs for whitespace? <2> yes <2> for indentation <3> :set expantab ? <1> guilty <3> me too <1> I actually have to confess to a grave sin <1> I'm editing this script in visualstudio.net on windows <1> cause I don't have a better editor in windows <1> and my linux computer has become unstable <1> :'( <2> get vim for windows
Return to
#python or Go to some related
logs:
ubuntu private socket dir: Permission denied gdm #web #ldap #nvidia #web gnucash missing fonts #physics #suse belnet kororaa Starting MySQL ERROR! Couldn't find MySQL manager or server
|
|