#apache #archlinux #asterisk #centos #debian #gentoo #haskell #kde #kubuntu #lisp #math #mysql #perl #python #ruby-lang #rubyonrails #suse #ubuntu #vim #wikipedia 0 1 2 3 4 5 6 7 8 9 10 11 12 13
Top Prev 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 Next
#python
<RaverWild> oh ok. thanks
<RaverWild> what about the other code?
<pjd> i'm not sure about the actual problem; that kind of thing can be terribly finicky :/
<pjd> you might want to try asking on #twisted too
<pjd> there are likely to be people with more immediate experience
<RaverWild> the actual problem is that on py2.4/suse10 i get "bad file descriptor" on unregistering and closing lines. i should make a check before executing these lines and have no idea of what to check exactly
<PDani> hi
<ikor> so, is it clear for now? anyone has some idea, where i should lookup?
<AniHatzis> thank you pjd, i think i found a good pattern at wxPython project.
<PDani> how can i use the str.split() funtion to get only the first part of the string?
<PDani> sth, = foostring.split() doesn't work
<pjd> AniHatzis: you might want to consider just putting the version info in your setup.py, or whatever
<pjd> there isn't often a real use-case for having it in the module itself
<Habbie> PDani, [0]
<sdanley> foostring.split()[0]
<PDani> ohh...
<PDani> :)
<PDani> thx
<pjd> ikor: hmm, what happens when you ln -s build/lib.linux-i686-2.4/s1crc32.so .
<pjd> instead of changingi sys.path
<pjd> "changing", even
<bluszcz> which way is easiest to use synchronous in twisted?
<pjd> bluszcz: using the thread pool, probably
<pjd> but not if you can avoid it
<bluszcz> I need use it with pylucene
<nachos> hello everyone
<nachos> i've created a very simple rot13 method, any comments on it would be great. http://deadbeefbabe.org/paste/3728
<nachos> its pretty much at where i want it, but any ideas on how i could compact it more and make it more efficent would be great
<Juhaz> 'string'.encode('rot13')
<nachos> i really dont like creating the 'letters' variable, but ascii_lowercase is just wayyy to long
<nachos> Juhaz: i wanted to give it a stab doing it myself
<Habbie> nachos, try to avoid importing *
<Habbie> nachos, in fact, try to avoid 'from'
<Jafet> how many batteries does python come with i've always been wondering...
<sproingie> Jafet: enough to stuff a python
<nachos> okay Habbie
<pjd> nachos: one other way is using str.translate
<Jafet> string.encode('rot13'), this is surreal...
<astan> hrmf. anyone know what i'm doing wrong here: http://dose.se/tmp.txt ?
<astan> i'm trying to fetch a file from FTP to a temporary file name.. i don't know why it wouldn't like that file descriptor :/
<Juhaz> you could use string.ascii_letters instead of lowercase + lowercase.upper()
<nachos> that's the nit-picking i like Juhaz
<astan> os.fdopen(fd, 'rw').write <-- using this as a callback for FTP.retrbinary(), where fd is a file descriptor from an mkstemp() call.. what's wrong with that? i can't see how it's different from the example at http://docs.python.org/lib/module-ftplib.html :/
<epifanio> i havent solve my issue, to try the code in script mode can i use in the bash shell
<epifanio> a line like this ?
<epifanio> bash%prompt>python /path/to/script-name ?
<astan> (there, the example is using open('README', 'wb').write as a callback).
<toma^> just one last question :) Any idea how python's prompt separates the commands so it knows when to use eval and when exec? or is there some function which handles both of them so I can just write executethis( "z=4" ) and executethis( "z" ) and it works like the normal prompt?
<pjd> nachos: also, ''.join( lookup.get(c,c) for c in text )
<pjd> that avoids the temporary list
Previous Page Next Page