| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Comments:
<0> mysticgoose: read the tutorial. it will get you up to speed <1> mysticgoose: try it. paste it. <2> I have limited time <2> and learn much better by example <1> you know what a while loop is, so try to do that and lets see what you've got. <2> thanks, I will try <2> logically I don't know how to try to build it though <2> but i'll work through it <3> would anyone else be interested in that? a blog aggregator #python members who blog? <4> Jerub: please don't call it that <3> Leeds: planet.weedpython.org ? <3> ;) <3> hashpython? <3> sharppython ? <3> ;)
<1> poundpython.com is camped. <4> hashpython is what I'd call it <1> Jerub: we already have planet.python.org. do you really think a seperate planet would be beneficial in any way? <3> ironfroggy: it filters out those worthless people who don't go on irc. <3> (and I, for one, aren't on planet.python.org) <1> but what about all the people who would want to read both and all the people who would want to be read by both? getting the same post twice in your reader is very annoying. <3> I read a bunch of aggregators where people post on both <2> http://deadbeefbabe.org/paste/673 <2> this look any better? <1> Jerub: ditto. and i dont want more. <2> it's not a while loop or anything, just changed what I had originally around a bit <1> mysticgoose: its still going to crash if you run it too long. <1> too long might be a very short time. <0> mysticgoose: the problem is that the first function never exits <2> if I put a delay of say 600, or 10 minutes, on function 7 <2> will it last a while do you think? <1> maybe. but thats a terrible practice. just write a damn while loop :-) <2> heh, I don't know how! <2> lol <0> http://docs.python.org/tut/node6.html <0> read that <2> well I know HOW to use a while loop <2> I just don't see how one would fit the structure of my program <3> mysticgoose: what are you trying to do? <3> in general terms. <4> mysticgoose: do you know what a while True loop is? <2> it's printing data to a series of printers <1> mysticgoose: you understand the concept of a while loop? <2> Leeds, I have a good idea now that' you mention it, but I wasn't aware <2> yes ironfroggy <3> mysticgoose: okay, no, lets slow down. <3> mysticgoose: in general terms, what are you trying to do? <2> while x > y, x + 1, else print "x is equal to or greater than y" <2> well, it's sending information to a series of printers, hypothetically <3> printers? as in phsyical sitting on a desk connected by cat5, printers? <2> using the jet direct protocol, they print off anything sent to them <2> network printers <3> okay, cool. <3> So you have a list of addresses of these printers, right? <2> yes <3> okay, so basically you want to write a function. <2> the 192.x.x.x aren't them, but I didn't want to give out those addresses so I changed them <3> printToThisPrinter(printer) <3> then you just do: <3> for printer in allprinters: printToThisPrinter(printer) <5> I have a 65mb .csv and 4 initially empty python lists...I read the .csv in line-by-line, break off the first four items with a regex, and for item 0..3 check if it's already its corresponding liist...if it isn't, I add it <5> how long ought that take? <2> yep, I'm lost <5> about 2,800,000 list inclusion tests, probably 50ish total list inserts, 700,000 regex applications <6> hey can someone give me a hand using basehttpserver please? I think my question is pretty simple, I just want to know how to parse the form from the html page iin my get_post() function <4> cyyoung: are you using the csv module? <1> cyyoung: you should import csv instead of using your own regexes <6> like if I was calling a cgi file I could just use bgi.fieldstorage() <6> *cgi <6> and I'd get a dictionary with all the data from my form <1> PerceptualChaos: use the cgi module <3> mysticgoose: I had hoped that I was as clear as possible. <6> I need to do that from my get_post routine <3> mysticgoose: I can only conclude that you need to go through the python tutorial once more, and maybe read a book like diveintopython or thinkcspy <2> I'm sure you were Jerub, I, however, didn't undrestand and that's my problem
<2> yep <6> ironfroggy, can you give me a line of code to use, I'm not sure how to get it work <3> mysticgoose: I suggest you do some more reading and understanding of code before you come back to this problem. <2> thanks for all of the help though, I'm going to try to make something of it <6> where does self go? <2> well I only have tonight to solve the problem <3> mysticgoose: and if you're sleep deprived, go have a good sleep, that helps the learning process no end. <2> I need a working piece of code by 9:00 AM <1> PerceptualChaos: just use cgi.FieldStorage. it takes a file-like object for its data and parses it into the same thing youd use in CGI. <1> mysticgoose: do you understand that code Jerub showed you at all? <6> ironfroggy, that doesn't work. If I go form=cgi.fieldstorage() the result has length 0 <6> I even tried it with an example straight out of a text book and it didn't work <1> PerceptualChaos: "it takes a file-like object for its data" i said :-) <1> PerceptualChaos: if you dont p*** it anything, how would it know what data to work with? by default i would just read stdin. <2> ironfroggy, yeah, a bit <1> mysticgoose: did you understand what a for loop does? what the allprinters is supposed to be? <6> I tried going cgi.fieldstorage(self) <1> PerceptualChaos: what is self? <3> incorrect case. <2> not sure what allprinters is <3> mysticgoose: a list of printers <3> i.e. <6> where self is the basehttpserver request handler <2> allprinters is a function to use for all of the printers, right? <2> oh <3> ['192.168.0.1', '192.168.0.2'] <1> mysticgoose: you're defining seven functions that are all identical except one value. thats why we have parameters. <6> I'll paste the code to pastebin <2> yay, I have an allprinters list! <6> http://pastebin.com/752787 <6> ironfroggy, are you familiar with basehttpserver? <1> PerceptualChaos: no, but im familiar with http. do you know how to get the raw POST data? <6> no? <1> PerceptualChaos: it should be in the docs for BaseHTTPRequestHandler <6> http://docs.python.org/lib/module-BaseHTTPServer.html <6> I guess the data is rin but its not necessarily a string <6> I'm a bit of a python newb which doesn't help <3> PerceptualChaos: what are you actually trying to do? <6> *rfile <3> star r-file? <6> I'm trying to get the data from an html form <6> using basehttpserver <6> thats all <6> :) <3> PerceptualChaos: okay, you've actually told me how you're trying to achieve your goal. <3> PerceptualChaos: but you've not said what you're actually doing. <6> well thats all I want to do at this stage, its a learning exercise for me <6> I want to be able to read data from an html form <6> and I have to use basehttpserver <6> I just had an idea, maybe I can use self.rfile as the argument to cgi.fieldstorage() <3> stop getting the case wrong. <3> it's spelled FieldStorage <3> PerceptualChaos: 'read data from a html form' is entirely a lie. <3> are you trying to write a server that will interpret a HTTP GET or POST? <6> Jerub: yeah pretty much <6> :) <3> PerceptualChaos: okay, now why do you have a requirement to use something as simplistic as BaseHTTPServer? <6> its for a project <7> hmm, ok.. i'm trying to break up this gigantic function, but then i have to p*** huge amount of arguments, which i don't think desirable... what should i do? <3> PerceptualChaos: why aren't you using CGIHTTPServer or SimpleHTTPServer? <7> s/huge amount of arguments/huge amount # of arguments <6> because the lecturer wants us to learn baseHTTPserver <4> ah... homework <3> oh, I see. <3> now the truth comes out. <3> good luck with that learning. <6> ha its not like I'm not allowed to ask for help <4> yeah, but the fees for homework help are higher <6> its a 50% project, we have to make an ntml messenger program <6> *html <7> is it desirable to p*** 10+ number of arguments? <7> .. <4> you should be using xmpp then <6> lol
Return to
#python or Go to some related
logs:
#math xen ubuntu kubuntu dualhead contraposotive #centos FAT: invalid media value (0x2f) #ubuntu #ldap BIOS ROM 786K1 fglrx problem buildpkg basename audio player not using X
|
|