@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14



Comments:

<0> uphill: E.g. you need to recompile it to have more than 256 simultanous clients. lighttpd supposedly is better, though I haven't yet migrated to it. The 256 gives me problems from time to time; I handle a million transactions in my Python web app per day on some days.
<1> FlimFlamMan, you mean a dict
<1> FlimFlamMan, lists always maintain their order
<0> FlimFlamMan: Well, that's what an ordered dict as implemented on that odict site and many others, is.
<2> yes
<3> Erwin: witch webapp?
<3> Erwin: witch framework did you use?
<4> burn the witch!
<4> erm, sorry
<3> lol, sorry
<4> I couldn't help it, you're both spelling "which" wrong
<5> Ceran: aye. hence my comment about ordered dict not really helping you. A sorted dict where you care more about the speed of sorted operations than about memory is implemented somewhat like an ordered dict (dict and list, together) but the items are inserted into the list using a binary search algorithm (like the 'bisect' module conveniently provides.)
<3> i am not a native english speaker :)
<0> uphill: Unfortunately my needs were too specialised -- my app server is a HTTP server taking requests by means of mod_proxy (just use ProxyP*** in your virtual host).
<6> easy question. can you do "f" in f, where isinstance(f, file)?
<0> uphill: Today, I'd use twisted because I need other things than just a simple HTTP server.



<4> kbrooks: easy answer. Try It And See.
<3> Erwin: yeah twisted is verry good, but so much docs
<5> AcidReign: beat me to it ;)
<4> Yhg1s: :-)
<0> kbrooks: Ify ou do "line\n" in f, that might make sense.
<4> Yhg1s: thanks for your help before (don't ask with what, 'cause I can't remember which part you helped with, but I'm sure you did...)
<0> kbrooks: However you can only search "forward" in the file.
<6> erwin: forward?
<4> kbrooks: from the current position, to the end
<4> the opposite of "backward"
<0> uphill: Well, it's a complex but powerful framework. Whether it's relevant for you depends on your needs.
<0> kbrooks: It reads from the file as it searches
<5> AcidReign: eh, I don't recall helping you. must've been by accident.
<3> Erwin: i need remote objects with javascript, a server for a propritary protokoll in our company and static content html :))
<4> if anyone is the least bit interested, in what came of my questioning/ranting in here all week: http://www.python.org/pypi/xmlmodel/
<6> WTF?
<6> i have a ... bug
<4> Erwin: you too, thanks for any help you gave me (which I only vaguely remember)
<4> kbrooks: squish it!!
<6> >>> f = file("x")
<6> >>> f.write("")
<4> kbrooks: pull its legs off and burn it with a magnifier!
<6> >>>
<4> kbrooks: you need file( "x", "w" )
<4> to write to a file
<6> AcidReign: IT WORKED
<4> define "worked" ...
<4> can you do: file( "foobar.txt" ).write( "foobar" )
<0> well, f.write("") doesn't write anything.
<6> AcidReign: well, it allowed a blank string by
<4> then do cat foobar.txt in the console?
<6> ah, returns None
<5> ... it always returns None.
<0> f.write doesn't return anything
<6> Yhg1s: thats stupid. it should return len(written)
<3> Erwin: WOW, you are my hero, you ve bringing me to twisted
<3> Erwin: thaht look so fine
<0> uphill: Well, twisted may not be for you. If all you want is web, then I think the other servers e.g. Turbogears + Django are better
<0> If you just want to get your HTTP requests in and handle then while also doing outgoing SMTP connections and allowing the user to login via SSH to the server while deferring a database query to another thread, resuming the HTTP connetion when it completes...
<5> kbrooks: why would it? it always writes the whole thing.
<3> Erwin: i have written a litte JSON-RPC-Orb
<3> Erwin: that is all what i want it have to do with the web
<3> Erwin: except the static html docs
<6> Erwin: do we always say "twisted!" to everything?
<0> kbrooks: Uh, I suggested TG + Django.
<6> Erwin: i was just asking
<3> Erwin: thanks a lot i will look at all
<0> Having said that, I think TG uses Cherrpy for its dispatching etc.
<0> But I think TG is more accessible than just CP, it's more of a package
<3> i know tg
<7> what is a Python sprint?
<8> kapputu: a sprint is an event, like a conference.
<9> Yhg1s: heh, thanks for the hint. I just implemented a rudimentary binary search algorithm :)
<8> kapputu: except it's where you get a bunch of competant hackers, stick them in a room, feed them curry, pizza, caffeine and chinese food for a week
<8> kapputu: and hope they come out the end a) completely and utterly knackered, b) with code.
<0> the "sprint" part refers to what they do to get to the bathroom after the feeding
<7> hmm
<7> are there any Python User Groups like LUGs?
<10> kapputu: there's one in chicago
<11> Anyone remember a challenge a few years ago where programmers wrote the same script in different languages to see which was shortest or fastest?
<11> I need to find a link to info about it.



<7> smithj: I'm in California though
<10> kapputu: yeah, i'm not in chicago either, but i just saw the ad on the mailing list
<7> Does Python have anything similar to Perl's Win32::API::* modules?
<5> kapputu: the win32api module, part of the win32all package.
<5> kapputu: http://python.net/crew/skippy/
<12> How can I use python to detect which OS I'm using?
<12> (naturally, I'm looking for a platform independent way of finding this out.)
<1> os.name
<12> thanks
<1> sgeigerbot, will give a rough idea
<13> sgeigerbot: what about OS X? =)
<1> The following names have currently been registered: 'posix', 'nt', 'mac', 'os2', 'ce', 'java', 'riscos'.
<14> there is no windows identifier?
<1> ironfroggy, I think that's what 'nt' is for, but I could be wrong
<14> thats what i get on my xp box, so it must be. i suppose not many used python in the pre-consumer-NT days.
<14> on non-NT windows versions, that is.
<5> there's also sys.platform, which provides slightly different information.
<5> (a bit more detailed.)
<0> and then there's the platform module
<14> might be safer, because you have to consider that IronPython doesnt' support an os module yet.
<6> ironfroggy: it does, if you add it in
<14> add it how? ive never actually used ironpython.
<6> ironfroggy: uh, copy os.py to Lib/.
<6> thats how
<14> i didnt realize os was just a python file. i figured, with the os-specific stuff, itd need some extensions to function.
<15> what's ironpython?
<6> pally: py on .net
<14> python written in C# to run on .Net
<15> kbrooks: o, thx
<16> Hey. Which would be quicker for checking if a string contains 2 "7"s in it: a.count("7") or re.compile(".*7.*7.*").match(a)?
<15> .net, quite new to me
<17> WhatTheDeuce: probably the .count
<14> thats why we have a count method.
<6> WhatTheDeuce: NEVER use ****y re's. AT ALL, EVER
<18> WhatTheDeuce: ".*.7.*7.*" won't match "foo77bar", and it can match more than 2 7's.
<9> Is it possible send non-numeric values to __getslice__? Whet I use strings, it says they're not hashable.
<18> WhatTheDeuce: Perhaps what you wanted was "[^7]*7[^7]*7[^7]"
<19> Ceran: strings are certainly hashable
<18> WhatTheDeuce: Actually, it does match 'foo77bar', but it will match more than 2 7's.
<9> teratorn: that's what I'm saying
<14> to strings, no, but for custom types you migth accept non-numeric arguments. hence it being custom. what would you expect a string to do with string['foo':'bar'] anyway?
<0> Ceran: I don't think __Getslice__ is supposed to be used. __Getitem__ is what gets called, with a slice object or an ordinary object.
<19> Ceran: no idea why hashes would be involved in a slice anyway
<17> Ceran: use __getitem__ instead
<19> Ceran: you're not trying to slice a dict, or something crazy?
<16> sorry about the ".*.7.*7.*" that was a typo. I meant ".*7.*7.*", which will do the job I want it too (I'm looking at least 2 "7"s). I'm just curious about speed, and cybercobra seems to have answered my question
<9> cybercobra: but how do I send a range to __getitem__? Doesn't it only take a single value?
<9> teratorn: er, uh, maybe
<17> Ceran: it can take a slice object
<19> Ceran: well that doesn't make much sense, does it
<0> you can make your own slice objects using slice()
<19> Python could really use better error reporting there
<0> slice(start, end, stride). That's what __getitem__ gets when you type foo[start:end:stride]
<9> teratorn: I'm subcl***ing dict to keep a sorted list of keys so I can iterate through key,value pairs in order.
<0> So to support slies, your getitem just checks whether you got p***ed a slice, or not
<0> There's no limit on types there, e.g. xmltramp lets you do node['foo':] to get all the foo-subnodes of this node
<19> Ceran: ah, well there are already a few implementations of OrderedDict's
<17> Ceran: there are several recipes for an OrderedDict
<19> Ceran: so you want the slice 'start' and 'end' to actually be keys, then it finds the appropriate objects based on the order
<9> teratorn: None I've seen keep it sorted. They maintain insertion order. not sorted order.
<19> interesting
<19> Ceran: oh, ok
<9> Erwin: But what is getitem supposed to do with a slice object?
<5> Ceran: what you want it to do.
<0> you can examine the start, end and stride and then...
<5> since you want it to extract a range, make __getitem__ return the desired range for that slie object.
<0> If you have a list, then you can apply it to the list to get the keys, if that's your plan
<20> well arent you all a talkative bunch
<1> yep
<1> we're just whispering so you can't hear us
<14> shh
<9> Yhg1s: got it, thanks
<6> OK, lets see


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #python
or
Go to some related logs:

sinattaj
#gentoo
gentoo uninstall x11 equery
#math
#linux
#linux
#bash
mysql.hosts doesn't exist
sql lowest available id
Compaq Computer Corporation FibreChannel HBA Tachyon



Home  |  disclaimer  |  contact  |  submit quotes