| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Comments:
<0> Nope. <1> well, when you use google you use linux :) <2> i've been working google. havne't found anything , that's why i asked <3> Yango, something uses linux. I wouldn't agree that it is you <0> And now you know what to look for. But the short answer is that you can't. <3> That's like calling me a drug addict because my agent does coke. <4> MachinShn: I believe it's not possible with glob at all. <5> MachinShn: glob each separately, and join the results <4> MachinShn: You could do glob.glob('*.bmp') + glob.glob('*.png') etc. <2> ignacio: and instead of telling me to google, then being an *** about it, a simple you can't would have been satisfactory <2> thanks sanxiyn & deltab <1> Brend your analogy ****s :) anyhow, here's not the place to discuss the actual usage responsibilities of internet provided services <0> No, because then you wouldn't know how to find the answer. <2> ignacio: you presume that everyone who comes into the chan asking a q is a complete noob? <4> ignacio: Please stop. <3> MachinShn, perhaps everyone who comes into the channel asking a question they could easily have answered for themselves ;)
<2> sigh. i'm just gonna stop now. cause i've been on the other side of this, and it's too easy to be a complete cockbiter on both sides <6> i am using select() to determin if a socket is ready to be read from, i am p***ing it a list of sockets, i need some way to relate my sockets to instances of a Client cl*** i have created, i could just for through the list and compare each entry to the entries in my Client instance list but that doesn't seem sensible, is there a better sollution? <6> i aquire my list of sockets by looping through my Client instances and requesting their socket reference <4> jotham: Hm, a dictionary? <6> i still need to have a key though <6> can i put a reference to my Client instance in my socket instance? <6> so i can s.client.dosomething() <6> it doesn't sound very tidy <6> but does adhear to the ideas of composition <4> jotham: I think you can use socket itself as a key. <6> :o <4> It will hash using identity. <6> does that use the __repr__ or what <4> Or, you could use socket.getsockname(), I guess. <6> identity? <4> jotham: It uses id(socket) <4> Basically, memory address of that object. <6> cool <6> cheers <4> Maybe fileno() is another possibility. <4> (file descriptor of it) <6> naah, id sounds good <6> since non overlapping lifetime wont be an issue <7> hi there <4> hi <7> does somone nows a bit in pyhton? <7> knows* <4> ? <4> Well this is #python... <7> well i know that but last time i ask somone and he told me he dont use to prog in python <7> so thats why i ask :) <7> well sanxiyn perhaps can u help me <7> ? <8> Etrius: you have to actually ask a question before *anyone* can help you with it <9> Etrius: don't ask to ask, just ask! =) <7> LeedsHK, thats true :p <7> shure <8> Etrius: so, uh, do you have a question? <7> well i have to do a script to read an html page .. so i must login on my page then read the content but i have to put somthing to read a chain data on this page and i dont know how can i do it <8> ah <7> yuo here it is LeedsHK :) <4> Etrius: Eh... so you do login? <7> yup <7> i did it with to different scripts <7> but i use add-header('Cookie' for the last one seems better <7> add_header* <4> Etrius: Have a look at http://docs.python.org/lib/cookielib-examples.html <4> cookielib manage cookies for you. <7> yup i did <7> the probleme is not on the cookielib <4> (i.e. sends Cookie: after it saw Set-Cookie:, etc.) <6> can you iterate through a dictionary? <7> i use urllib2 <4> jotham: Yes. <6> oh, iteritems iterkeys <6> sorry <4> jotham: Well, "for key in dic" also works. <6> hot <4> Etrius: I'm not sure I understand what the problem is.
<7> well my exercise is a bit complicated <7> let me explain u <8> exercise? is this schoolwork? <4> LeedsHK: I don't think so. <7> LeedsHK, not schoolwork but same :) <8> sanxiyn: it's a brave new world out there, my friend <7> well here is all the work i must do on my script : first login on my page secondary must read the page to collect a data wich change every connexion then request an other page with a parse.valid=data <7> so am i clear? <4> Yup. <4> Do so. :-) <7> well so on my script i must use urllib2 <7> then i import urllib2 <4> And... (drumroll) <8> Etrius: is it a public page? <7> nop <10> hi im new to python <7> hi catseye <10> which distro of python should i install? <4> catseye: hi! <4> catseye: Your platform? <10> windows 2003 <4> http://www.python.org/2.4.2/ <4> "Just save the installer file Python-2.4.2.msi to your local machine, then double-click" <6> using activepython gives you a great documentation reference in windows help format <6> http://www.activestate.com/Products/ActivePython/ <6> there is a 2.4 release as well <4> jotham: python.org distribution provides .chm too now. <10> oh <6> cool <4> Since 2.4.1 or so I think. <10> so which one? <11> how can i access GET and POST values in a cgi script? <4> ActivePython is also good, or so I heard, but I always uses python.org one personally. <4> spootnick: http://docs.python.org/lib/module-cgi <7> sanxiyn, import urllib2 <7> req = urllib2.Request('http://mypage/Parse.php?valid=data') <7> req.add_header('Cookie','login=Mylogin ; p***word=Myp***') <7> r = urllib2.urlopen(req) <7> print r.read() <7> here is my actual script <8> Etrius: you know you should paste to the pastebin, right? <7> LeedsHK, ? <7> u mean? <4> Etrius: Eh, I don't understand. If you use cookielib, you won't need add_header Cookie: at all. <4> Etrius: See /topic. <4> Over 3 lines? <11> sanxiyn: no mention of GET or POST <4> spootnick: Eh? <4> You do this: <7> its a POSt method <8> Etrius: if you're going to post anything that long - certainly anything longer - you shouldn't just put it in the channel, you should put it on a website and give us a link <4> import cgi <4> form = cgi.FieldStorage() <4> value = form.getvalue("some parameter") <7> hooo ok LeedsHK my apologise didnt know that it was forbiden to copy past on the channel <4> spootnick: FieldStorage treats GET and POST same. <11> ah ok <11> sanxiyn: thanks a lot <8> Etrius: it's not such a problem now - but imagine if 10 people were pasting code to the channel at the same time <7> thats true LeedsHK sorry for that :) but my english is a bit bad and i couldnt explain more about my probleme <8> Etrius: no, 100% post your code, but put it on the web, not the channel - the code is often the best way to explain the problem <11> sanxiyn: for curiosity sake, is there a way to fetch GET values only? (or POST values only) <4> spootnick: Hm, interesting indeed. <10> does active python come with an ide? <4> catseye: No. <4> Well, both ActivePython and python.org version comes with IDLE, a Python code editor written in Python. <7> well anyway here is the code and the thing is that i must read the data on every connexion to req my Parse.php?valid=data <8> spootnick: QUERY_STRING or REQUEST_URI in os.environ? <10> what is extra that is in activepython thats not in the regular python? <4> spootnick: As far as I know, you can access REQUEST_METHOD from os.environ. <4> spootnick: And mixing GET and POST is invalid according to the standard. <11> LeedsHK, sanxiyn: yeah, seems to be the only way <4> (Not that mixing of GET and POST isn't done in the real world. But it's invalid AFAIK.)
Return to
#python or Go to some related
logs:
#css file::temp perl unlink0 gentoo madwifi ioctl[ieee80211_ioctl_setmlme] #perl fluxbox 1680x1050 #gentoo #python C-Media Electronics CMI9761 + slackware #qemu honeywell dps6 value
|
|