| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Comments:
<0> Alpha: I don't know about that -- a hardware buffer could only be addressed on the link layer, which is below TCP, and below IP. Perhaps, e.g., on the Ethernet layer. <1> CardinalFang: actually, it doesn't always append space <0> Teach me. <2> I see, well i'll cross that bridge when I come to it as it were <1> CardinalFang: when you use a comma at the end, no space is output until something else is printed <1> and not at all if the value ends in a newline <3> select.select can take files or file descriptors as parameters, right? <1> yes <1> and anything with a fileno method <3> I must be doing something else wrong <1> cout: getting an error message? <0> Alpha: Ha ha. <3> no <3> I call select and it returns, so I call read to read data, but read blocks, so I never go back into select <0> What does select say is ready to read? <3> a pipe that was opened with fdopen by the popen2 module
<3> I thought I had this problem licked yesterday, but I was just imagining that I did <4> (I am not a Python programmer, please excuse my ignorance for sometime) I have a zope product script which: from Products.BTreeFolder2 import CMFBTreeFolder - but i get: ImportError: cannot import name CMFBTreeFolder <4> the CMFBTreeFolder.py script is in Products/BTreeFolder2 <4> and yet this error comes <5> cout: don't mix select with stdio <5> cout: if you use select, use os.read <3> erwin: is it safe to use os.read with a file object? <4> can someone just guide me to correct doc or any other help - thank-you <5> cout: you p*** the obj.fileno() to os.read(). <3> erwin: I know that, but is that a good thing to do? <5> cout: Is there an __init__.py file in the BTreeFolder2 directory? <4> yes <3> czaveri, I think you mean <4> :-) <5> cout: That's the only right thing to do. If you want to use select, you must not use buffered IO <4> yes, it is there <5> czaveri: Did you ask google for you error? It's like some isntallation/Zope issue. <3> erwin: does python provide access to the buffer? <4> i looked at Google for a lot of times - but no solution - so i came here <4> it is not installation issue because all else is working fine <4> many other files importing modules but no problems with any <5> cout: Yes, that's what the file object method's use <4> isn't there anything that exports module name? <4> or may be the namespace changed? (pls excuse ignorance) <6> anyone willing to help a noob with the while command? <3> erwin: I meant direct access, e.g. can I check if there's anything in the buffer before p***ing the file object to select (or does select already do that?) <6> it's stuck in a loop and i dont know why? <5> czaveri: Zope does its own thing. If you can run the script from the command line, use python -v or -vv to trace how it imports things <5> cout: You cannot. And select doesn't use the file object, it only uses the file descriptor. <4> ok, i will try that, thank-you Erwin <3> that's different than I'm used to, but I guess I can work with it <5> cout: Hmm? It works exactly like that in any language <3> ruby's standard lib does check the buffer first <3> you still have to use sysread instead of read, though <5> Ruby has a select system call wrapper that takes file descriptors or file objects and returns true for the file objects that have pending data in a buffer by direclty peeking into FILE* internals? <3> yes <5> Wow, that's ****ed up. <5> I don't see anything about that behaviour in http://www.rubycentral.com/book/ref_m_kernel.html#Kernel.select <3> that's a really old version of the book <7> I am looking to run a linux command from within my python script what is the best way to do that? <8> os.system <8> also look at the subprocess module. <7> Do you know if os.system waits for the process to complete before running the rest of the scripts? <3> I should submit a documentation bug for that. the documentation for Kernel#select refers me to Kernel#select. :) <9> JeSuisMor: i think so <9> os.system returns the exit code from the command <10> re <7> Ok cool thanks <9> re re <10> I'm really lost with my imports <3> how do I capture an exception if I don't know what it inherits from? <9> JeSuisMor: test it <10> I made sure that there's no circular imports <9> maybe do os.system("sleep 5 && echo 'os.system completed'"); print "python script after os.system" <8> try: ....; except ExcptionName: .... <10> and still, I can't import another module which from current module's parent module <8> cout: why would you need to know where the exception is inherited from to catch it in a try: except? <8> eleusis: import time; help(time.sleep) <9> er
<9> sysfault: i suggested that code to test the execution of os.system <10> if in foo.module2.modb, I have import foo.module1.moda, and I do import foo.module2.modb from interpreter it won't find moda though if I do import foo.module1.moda from interpreter it works, and I'm clueless <10> I tried tickering sys.path, unsuccessfully <8> eleusis: looks like you suggested it in accordance to his question on how to delay execution of a process while another one is being executed. <11> any pygame users here? having a problem and #pygame channel hasn't helped me yet :/ <3> sysfault: I mean I can write 'except Exception, exc' to capture the exception into exc, but that only catches exceptions that inherit from Exception; I want to know if there's an equivalent syntax for any kind of exception, even those that don't inherit from Exception <9> sysfault: is that the question JeSuisMor asked? <8> cout: hmm, except: with no arguments catches all exceptions afaik. <9> aanyway <9> goodnight ;) <12> what's a descriptor in pythonesque? <9> a descriptor? <3> sysfault: but then I have to use sys.exc_info() to get the object; is there a syntactic shortcut? <12> yes, a descriptor <9> what kind of descriptor? <12> descriptor 'date' requires a 'datetime.datetime' object but received a 'int' <8> cout: don't think so. <9> hm <3> that's what I thought. I think I need the traceback anyway, so I'll just use exc_info(). <12> cout: except: is a DON'T DO THAT issue I'm starting to learn its value :) <9> not sure <3> yango: eh? <9> i'm guessing you p***ed a value of the wrong type to a method somewhere <13> Does "print "*%s%s" % (spacer, "*")" suppress all automatically inserted spaces? <8> why would the particular string produce spaces? <12> cout: that using only 'except:' is awful pythonic practice, according to experts <13> well, every time you do "print spacer, "*"" it adds a space <13> between spacer and the string <8> you may want sys.stdout.write() <14> is there a nice python reference other than the official, I find it hard to find what I need on the official one <14> ? <8> using a trailing comma appends spaces by default before the training text. <8> trailing* <14> I mean, the info it provides is nice, but it takes tons of time to find the functions I need <3> yango: depends on what your goal is <13> sysfault: exactly, so if I wanted to print a string, a variable, and then a string, it adds spaces, but pritning with formatting suppresses spaces, right? <12> cout: sure <14> oh, found something <8> yes, shouldn't produce a space. Try it in the interpreter. <3> yango: in my case the except: is at the outer edge of a thread, and if there's an uncaught exception it goes to the terminal, where the user might not see the message <12> cout: I'm just pointing that out because I tended to think my goal justified the use of except: alone, but in the end didn't <14> http://rgruet.free.fr/PQR24/PQR2.4.html <---not bad <13> sysfault: the sys.stdout.write(), what do I need to include to use that? I am new to Python <12> parker` import sys <13> thanks <14> which function can I use to run an external program and learn about it's return value? <15> genia4, if you're on 2.4, I recommend the subprocess module <13> newbie question: if I want to print an integer as a string with write, how do I do so? i.e. sys.stdout.write("size: " + size) doesn't work, neither does sys.stdout.write("size: ", size) <14> benji: nothing simpler? <14> I don't need any input/output redirections <16> genia4: os.system() <12> "size: " % (size,) <14> just run a process, block, and get success/failure :) <12> sorry, i mean <12> "size: %s" % (size,) <14> thanks luc*** <12> or "size: " + str(size) <13> ahh <15> genia4, see subprocess.call <14> aha <11> any pygame users here? having a problem and #pygame channel hasn't helped me yet :/ <14> benji: wow, subprocess is nice <14> thanks <15> np :) <6> i need some help with the while command creating a loop <14> python's docs need to learn from php :( <6> anyone feeling kind? <15> GMullen, just ask your question, then you'll know how kind we're feeling :) <6> ok well first <6> i'm trying to add the problem code it pastebin <6> but only the first line it comming up <6> nm
Return to
#python or Go to some related
logs:
#css #physics perl + array+ sub chroot mknod Operation not permitted ubuntu libdvdcss checking for C compiler default output file name... configure: Run MMURTL in QEMU +gui library +single DLL #perl #kernel ironhand python
|
|