| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Comments:
<0> cb921: don'T do an eval() on the file contents ;) <1> ah. duh. <2> blight_: is execfile() any safer? <0> i guess not <1> if you stored it in a database with restrictive permssions? <2> blight_: I noticed last night that TurboGears uses execfile(). That kind of scared me, a little. <3> TML, hum.. didnt know that it existed.. i ll try reading about it.. thanx <2> sapo: Wish I could remember the name of the one I settled on. I'm pretty excited about the things it makes possible. <2> Oh, here it is <2> http://www.red-dove.com/python_config.html <2> cb921: Why would storing it in a database make things any better? <1> tml that's pretty sweet (config module) <2> Yeah, I like how it allows cross-references and mappings <1> less chance of `rm -rf /` being inserted ? <2> cb921: How so? <1> yah, somebody obiously sat and thought and worked quite hard at it
<2> Well, they refer to a wiki page where you can watch the conversation as some of the concepts evolve(d), which I found quite handy <1> well it's not just a file lying around on a wind32 box anymore - it's a p***word protected database field? anyway it's moot - if I got hold of this 'config' file I could probably do some damage.. looks quite complex <3> TML, thanx man, nice config cl***, i think im gonna use it :) <4> hi there <4> xmlrpclib seems to have a problem with <i22></i22> <5> if i import foo as bar, does it automatically follow that referring to bar.fubar later in the script will call foo.fubar ? <4> neutralrobotboy: ?? <5> hmm... i think not. this is really irritating. <5> i'm trying to do this, for example: import _xmlplus.dom.minidom as xml.dom.minidom <5> everywhere in the script, it is using this package as xml, rather than _xmlplus. i need to rename it on importing it to make the script work. <6> How do I convert a c_byte to a printable string ? <6> it's a c_byte_Array_64 <6> sry <7> for elem in c_byte_Array_64:\n\tprint chr(elem) <7> ? <7> I have no idea... :D <8> is there an easy test to see if something is pickable or not? something like if some_obj is something: pickle(some_obj) <9> Not that I know of, Yango. Just got to do write tests. <10> Yango, you can use exceptions for that <11> How can i see if sys.stdin holds a value? <9> joaop5, exceptions during serialization are tough-- what if the object is half-written on an unseekable stream? <8> hari`, what testS? <4> does anybody have an Idea why <i22>129759187597</i22> as part of an xml-rpc-reply gets filtered out by xmlrpclib ? <12> why is it i22 ? <9> Yango, a test suite to try various types, and add problem names to a list. <4> ne78: because i22 is a standard datatype in xml-rpc <13> i22? <4> zorbli1: yup <13> not in http://www.xmlrpc.com/spec <13> what is i22 ? <13> i mean what type it is ? <4> zorbli1: int wiht a length of 22 <4> at least my colleague implemented it like that and told me it was correct. <13> of 22 byte ? <4> maybe I should kick him ;) <13> 22byte seems a weird int to me :) <4> aaah <4> no wonder <4> of course it gets kicked out by xmlrpclib <4> ;) <4> just found the stuff <13> yep :) <4> zorbli1: but what would I use for a unix-timestamp? <13> a base64 <13> as it is a unsigned 32bit in unix, and xmlrpc does not support unsigned 32bit <4> ok <4> zorbli1: thx <13> btw why did you need 22byte to store a unixtimestamp ? <4> zorbli1: my colleague read about i22 somewhere (probably in some broken spec) and implemented it for the timestamp <14> I need a tutorial for creating a wrapper for a cli app. Basically spawn it, look for output and parse what happens as long as the program runs. I find it hard to find anything on this, but it must be common... <4> engla: where exactly is the problem? <14> hds: I know how to spawn it with the subprocess module, but how do I tell if there is anything new to be read, and how do I read that? <14> well reading from the stdout I can manage, but I have to poll for possible output, I can't stall waiting for it <4> engla: how about putting it into some kind of loop? <14> the gui has to be active meanwhile <4> hmm <4> ok <9> engla, two threads. <15> engla: multi-thread <14> seriously? Okay, is that easy?
<16> yes <16> very easy, ideally <14> okay, what about communicating with the main thread? <14> you sure I just can't ask the stdout if there are unread bytes in a non-blocking way? <15> engla: wide variety of IPC mechanisms available - Queue, Event <15> engla: should really call them "ITC" mechanisms <14> ok, so I need a module name. Or a link <16> well <16> lets see <16> you can communicate with ... :P <16> bbl swekl <17> engla: select <18> ola <7> Blac]{out: ciao <18> ^_^ <15> engla: watch out for partial lines of output, might be buffering/flushing issues <9> This is the whole reason that threading solutions like Queue were developed. Nobody wants to write "see if available, read a byte, append to the read chunk, see if there's a full chunk yet, do something with the chunk" code anymore. <9> One thread blocks on stdin reading a line as usual. When done, post it on the queue. One thread does its gui pump as usual. If there's an item on the queue, consume it. <6> can someone give me an example of how to walk through all members of a cl*** ? <9> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/82965 <19> robin_: for a in x.__dict__: <6> and what if I only want the values that start with "dw" ? <19> robin_: you mean keys? <20> for name, val in (attr for attr in foo.__dict__ if attr[0].startswith('dw')): <20> err, in foo.__dict__.iteritems() <20> nice and long :-) <6> fsafdf <21> hi! i would like to know if someone already wrote a cl*** to read a file (or another stream) bit per bit. I began to write such cl*** to read file (or something else with seek/read methods) bit/bit: methods getBits(address, nbits) and getBytes(address, nbytes) where address are in bits <9> I find that fugly. Why not just an if attr[0:2] != 'dw': continue ? <6> ffdsf <6> <21> i will also write functions to search a string (of byte), or bits, or string using regex <21> (I already wrote such search function (except search bits) but with byte granularity) <20> hari`, because you are repeating the information that 'dw' is 2 bytes long. *a prayer to the gods of DRY* <20> but yeah, the genex doesn't have to be there. <9> TFK, or whatever check you like, but don't stuff it into some fugly comprehension. The 'dw' constraint is separate from the dict traversal. <20> No - it is the direct constraint on said traversal. But I see your point. <6> TFK: could you repeat it ?.. my irssi went crazy <20> consensus: for name, val in obj.__dict__.iteritems(): if name.startswith('dw'): continue <20> err <20> if not name.startswith('dw'): continue <6> TFK: thx <6> or Thank You.. don't know if thx = AOL slang :) <6> or AIM.. <20> It's all good, as long as you don't say "lol". *ducks* <6> :) <20> Hmm, Scratch the nazi bot didn't strike... <22> TFK: it's biding its time... <22> waiting until you least expect it. Then *BAM* <23> TFK: whos scratch? <23> oh... I think I know <23> Can I lmao in here? <23> =) <24> keep you ao in here <23> damn... Komodo froze up on me... am trying to see if maybe it will unfreeze in a minute :( <23> Komodo imho is not at all stable on Ubuntu <19> isnt that payware? <23> gedit for dapper seems to be coming along nicely though although no support for gedit <6> :D <23> I meant no support for raw_input in gedit for Dapper <23> :) <6> that makes more sense ;) <23> btw is this a :) zone? <6> ? <19> unbalanced parenthesis? <23> this is a no el0el zone... thats a surprise... <23> TenOfTen: yeah, Komodo is 30 bucks for the personal... 300 for the pro... its highly unstable though... very uncomfortable with it so far... started the trial two days ago... am happy it is only a trial though <19> okay <23> am killing it now... <19> imo, you can win some things when using a language-specific editor, but on the other hand, you have to re-learn everything else youre used to from emacs (for example)
Return to
#python or Go to some related
logs:
--with-mysqli +winxp fsimage linux #linux #ubuntu ubuntu kmfclient kubuntu 2940 #openzaurus suse 10 roothack mesa-6.4.2-r2 opopanax gentoo
|
|