@# 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 15 16 17 18 19 20 21



Comments:

<0> zeaq_: my example will certainly do that
<1> joedj: fine... i'm testing
<2> zeaq_: you might look at SocketServer
<1> joedj: where can i find twisted and a short example
<0> zeaq_: twisted is not in the standard library though. http://twistedmatrix.com (i use the old version, 1.3)
<2> zeaq_: SocketServer is standard, doesn't need twisted
<1> HowardTheCoward: do you mean a should or i should use joedj's example`?
<1> HowardTheCoward: or i shouldn't...
<2> zeaq_: we don't dictate, we just suggest, you look at all suggestions and pick up the one that suits you most
<2> or best
<1> HowardTheCoward: yes of course. do you suggest joedj's example ;-) ?
<3> zeaq_: I dictate: Whatever JoeDJ suggested is what you use.
<1> Pythy: thank you *smile+
<0> zeaq_: are you implementing SMTP?
<2> zeaq_: I can't suggest you to use twisted because I've never used it so I don't know its strong points and drawbacks



<1> joedj: no. i should be a little daemon that should start process ask by a php script. so i could execute long scripts with other permissions
<1> HowardTheCoward: ok ;-)
<4> any ideas pls ?
<3> HowardTheCoward: I wasn't making a suggestion. It was a fiat. ;-)
<0> i didn't suggest anything :)
<1> joedj: if we returned to my source code once more. is there no solution to close the current child?
<2> Pythy: Even more so I take it personally!
<0> zeaq_: i don't see any obvious problems apart from the change to line 18
<2> zeaq_: Put that debug messages I've suggested, pastebin the code again and pastebin the debug output
<0> zeaq_: it might be blocking in readline() and never get to exit()
<2> Pythy: I follow Wader's rule: who's not with me - is against me
<1> joedj and HowardTheCoward: ok. thank you both!
<5> is there a native sleep funtion in python? that works on both windows and unix?
<3> time.sleep(0.001)
<5> s/funtion/function/
<5> thanks!
<3> Why's that, Howard?
<4> i have an extending and embedding project in python. i have a python module 'foo' that has a dict 'bar' inside it. how do i get the reference to 'bar' from c code ?
<6> Is it possible to transport multiple error strings in a Python exception? Such as raise MyException('foo','bar')?
<2> Pythy: because it's their fault people shall bother so much about compatibility
<3> Howard: Well, they did get ~95% of the PC-market. You're blaming them for missing that other 5%?
<7> pyqwer: just define your own exception. yes is the answer.
<8> Make an exception that has that as a constructor signature.
<6> blackdroid_wd: and how would I do that? I could do something like "cl*** MyException(?from which should I inhert?): p***" - but what should I do to add custom error strings?
<7> cl*** MyException(Exception): def __init__(self, str1, str2):
<7> and do whatever you need to extract the strings
<6> blackdroid_wd: Thanks for your help - So an exception is nothing else like a simple cl*** which has it's __init__ and so on? And how would I read back these strings in an except clause?
<7> def __str__(self): return self.str1 + self.str2 or somesuch
<7> that is up to you
<7> except MyException, e:
<7> print e.getString1()
<7> print e.getString2()
<7> if you defined those methods
<4> so no ideas on how i could get a reference to 'foo.bar' from C ?
<6> blackdroid_wd: Ok, great, that's really easy then. Probably I can also do a "self.errstr1 = errstr1" in my __init__ and access them via e.errstr1.
<7> Eblis: nope
<7> pyqwer: yes
<3> cl*** Oopsie(Exception): p***
<3>
<3> try: raise Oopsie('hi', 'there')
<3> except Oopsie, err_o: print err_o.args #==> ('hi', 'there')
<6> Eblis: What do you mean with "reference from C-Code"?
<4> i have a module 'foo' with a dict 'bar' inside it. and i want to get the 'bar' variable
<9> Eblis: PyObject_GetAttrString(foo, "bar")
<4> aha, thank you
<9> you can get a reference to foo with PyImport_Import("foo")
<7> im sure that could have been found from the python docs :)
<4> a new reference ?
<9> yes. see the api docs.
<4> ok, thanks. GetAttrString looks like the thing i want :)
<4> blackdroid_wd: i was looking through the docs but didn't find it :(
<10> With, ElementTree is it impossible to iterate through text nodes as a part of an elements children?
<10> As in DOM
<10> I find the way ElementTree handles mixed content a bit awkward.
<4> what exception does a dict raise if it cannot add an element ? i'm using PyDict_SetItemString and that returns -1 on error, i want to convert that to the appropriate exception
<11> huh?
<7> TypeError maybe
<8> Normally the only reasons you can't add an element are that the key isn't hashable or that you're out of memory.
<4> so out of memory it is :)



<11> unhashable is far more common
<7> yeah most likely tring to update with something that is not iterable.
<9> Eblis: eh,
<4> the key is a string, so it's hashable
<9> Eblis: almost all API calls already have an exception set when they return an error value
<9> PyDict_GetItem() is one of the rare exceptions
<4> shouldn't it say so in the docs ?
<4> it doesn't say anything about exceptions, just 0 = success, -1 = failure
<9> when it's one of the rare exceptions, yes
<9> if it doesn't say that it doesn't set an exception, it set an exception.
<4> aha
<4> thanks
<12> I'm using python 2.3 on windows. It comes with tcl and tk. I wonder how to add a tcl package so that I can use it with package require? Any docs about that?
<13> tralala, use ez_setup to install different packages
<12> where do I read about it?
<9> I don't believe ez_install bothers with *tcl* packages.
<12> viyyer: I couldn't find anything useful with google but it looks like it's for python packages.
<9> tralala: this is more of a Tcl question than a Python one, but I believe there's a Tcl equivalent to PYTHONPATH that you can set. I forget what it is, though.
<9> last i toyed with it was when I wanted Togl support in Tkinter, and that was, uuhm, long ago ;P
<12> Yhg1s: kind of... actually I care about the default value of this path in python for windows.
<4> Yhg1s: it's suggested that all python variables and methods declared in c code should be static. can anything bad happen if they're not static ? i need one of the variables in another file
<12> but I'll search for some tcl info, it might help
<3> TK_LIBRARY
<9> Eblis: the same thing that happens in other C code; the variable is visible anywhere, and it may clash with variables defined in other parts of the whole application (Python itself, other extension modules that are used, stuff like that.)
<4> aha
<3> & TCL_LIBRARY
<4> i thought there was something more sinister going on :)
<12> Pythy: thanks!
<3> (There's also a TIX_LIBRARY)
<13> tralala, ah.. I confused my self.. that you were asking about installing tk library for python
<14> G0T0 10
<11> xroberx: justify your existance immediately.
<14> :)
<2> xroberx: identify yourself or get banned
<14> i live to code in basic i have to admit it
<11> HowardTheCoward: you don't need a scary face, I'm here
<14> but i've to enter #python because there is no one in #basic :(
<11> troll
<15> hey anyone familiar with the 'trac' tool know if the administrator gets notified of new posts to bugs, or if they only get notified when the bug is reopened?
<16> Gambit-: ask in #trac on this server
<15> ah ok
<2> I still can't decide for keeping Python regexsps in an XML file or against it. Pros: I already have XML files containing configuration for my script, Cons: If some regexsps would have special XML symbols, i'll have to encode them somehow. Any feedback?
<17> hi
<17> some use postgresql here , if yes you use wich driver with it ?
<18> Hello. Why I get an error "NameError: name 'atan' is not defined" when calling atan(1)? http://docs.python.org/lib/module-math.html says it should exist and my python is rather up-to-date (2.4.1)
<11> fschmitt: import math; math.atan()
<11> b_52Free: psycopg2
<18> Jerub: Thanks.
<17> Jerub, ok thks
<19> Hi, I have written a script and want to run it in the python interpretor so I can play around with it, is this possible?
<20> yeah
<11> ArtVandalae: just type import scriptname
<12> ok, so in case someone is curious - if you need to extend tkinter on windows with extra tcl/tk packages the way to go is - copy the package in python_root_dir\tcl and then import it as: from Tkinter import Tk; root = Tk (); root.tk.eval ('package require your_extra_package')
<12> if this doesn't work (as in tile 0.7.2 and python 2.3.5) it is likely because your_extra_package needs different Tk version than your python has
<21> Is there a module of some sort to parse raw POST data?
<11> Bread`: cgi should be able to do it.
<21> Jerub, which method would I p*** it do?
<11> Bread`: I dunno.
<11> FieldStorage comes to mind
<11> I don't know how to make it work though
<2> Bread`: urldecode maybe
<11> help(cgi) and the python website would be helpful I guess
<21> It's an odd behaviour, that once the raw data has been retrieved, the file input field is missing from the FieldStorage
<21> I couldn't find anything even pointing to FieldStorage in the manual Jerub
<21> HowardTheCoward, it's raw post data, it's got all the tokens etc, would I be able to break it down with that?
<4> how can i find the name of an element from C ?
<2> Bread`: dunno
<21> Is there a command for module help?, I'm using a linux so I don't have the IDE
<12> you don't need ide - just type help (something) in an interactive session
<21> Thanks tralala, I've always just used python <script name>
<12> I'm always using an interactive session to test parts of the code I'm typing
<12> you should try it too, imo


Name:

Comments:

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






Return to #python
or
Go to some related logs:

gentoo mirrors xorg
open application/x-httpd-php
gentoo crontab conf
ubuntu éééééééééééÉÉÉééééé
fedoraresolved
CONFIG_HZ ntpd -crazy
restart aegis-virus-scanner
corefonts access denied
gaim gtkgaim.dll error
Internal error failed to initialize HAL! ubuntu



Home  |  disclaimer  |  contact  |  submit quotes