Python-list Digest, Vol 38, Issue 390

Edwin Gomez edgomez at consultant.com
Mon Nov 27 15:32:08 EST 2006


Regarding Topic number 3: 3. Calling a thread asynchronously with a callback (Edwin Gomez):
Thanks Bjorn for you quick answer and by the way, that works.  Diez, in answer to your question regarding async callbacks in C#; C# runs in a multi threaded apartments.  Many times we'll setup listener objects in a dictionary and each member is responsible for monitoring and manipulating it's own data.  In the case where data is shared, then of course, we use a locking machanism.
> ----- Original Message -----
> From: python-list-request at python.org
> To: python-list at python.org
> Subject: Python-list Digest, Vol 38, Issue 390
> Date: Mon, 27 Nov 2006 19:45:03 +0100
> 
> 
> Send Python-list mailing list submissions to
> 	python-list at python.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://mail.python.org/mailman/listinfo/python-list
> or, via email, send a message with subject or body 'help' to
> 	python-list-request at python.org
> 
> You can reach the person managing the list at
> 	python-list-owner at python.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Python-list digest..."
> 
> Today's Topics:
> 
>     1. Re: Several entries on Tile and TableList at the Tkinter wiki
>        (jim-on-linux)
>     2. shtoom complicated install (Croteam)
>     3. Calling a thread asynchronously with a callback (Edwin Gomez)
>     4. Re: Active State and Komodo... (Trent Mick)
>     5. Re: working with files and directories (halex2000)
>     6. Re: Calling a thread asynchronously with a callback
>        (Diez B. Roggisch)
>     7. Re: Calling a thread asynchronously with a callback
>        (Bjoern Schliessmann)
>     8. python skipping lines? (lisa.engblom at gmail.com)
>     9. can't get cgi values (ronrsr)
>    10. Re: can't get cgi values (Fredrik Lundh)
>    11. Re: can't get cgi values (Paul McGuire)
> 
> From: jim-on-linux <inq1ltd at verizon.net>
> To: python-list at python.org
> Cc: Kevin Walzer <kw at codebykevin.com>
> Subject: Re: Several entries on Tile and TableList at the Tkinter wiki
> Date: Mon, 27 Nov 2006 12:29:58 -0500
> 
> 
> Thanks for posting this entry,
> 
> The fact that a wiki or help site doesn't get a
> lot of traffic is not an necessarily an indicator
> of it's usfulness.  It indicates to me that the
> product, in this case Tkinter, may be easy to use
> and understand, after working with it a little, A
> lot of help may not be necessary.
> 
> A good example is the py2exe help site.
> At one time not to long ago there might be 8 to 12
> post per day, or more. Today by my unscientific
> count method, I don't think there are more than 3
> to 4 post per week.  Yet, py2exe and Tkinter is
> almost as valuable as Python. If we couldn't
> build programs for Windows, where would a python
> programmes's money come from?
> 
> Thanks again,
> 
> jim-on-linux
> http://www.inqvista.com
> 
> 
> 
> On Sunday 26 November 2006 15:50, Kevin Walzer
> wrote:
> > I'm not sure how often members of this list
> > visit the Tkinter wiki at
> > http://tkinter.unpythonic.net/wiki/FrontPage; this wiki seems to 
> > have less traffic in general
> > than the Tcl/Tk wiki at http://wiki.tcl.tk.
> > Given that, I hope it's not out of line for me
> > to call attention to several pages that I've
> > posted about integrating Tile
> > (http://tktable.sourceforge.net/tile) and
> > TableList (http://www.nemethi.de,
> > http://wiki.tcl.tk/5527) into Tkinter
> > applications. I've noted a serious lack of
> > resources/documentation about these two
> > powerful Tk components. In addition to some
> > documentation, screenshots, and sample
> > applications, I've posted updated versions of
> > the original TableList and Tile wrappers by
> > Martin Franklin.
> >
> > I should take this moment to thank Mr. Franklin
> > for his work on these wrappers; whatever I
> > added to them was pretty minimal compared to
> > the heavy lifting he did. He originally posted
> > them on the Internet last year, but the site
> > that hosted them has gone dark. Anyway, Mr.
> > Franklin, if you are reading this, thank you
> > for your hard work; it has been enormously
> > helpful. I hope my own efforts extend your work
> > and make it even more useful for other Tkinter
> > developers.
> >
> > Here are the links:
> >
> > http://tkinter.unpythonic.net/wiki/UsingTile
> > http://tkinter.unpythonic.net/wiki/TileWrapper
> > http://tkinter.unpythonic.net/wiki/TableListWra
> > pper
> > http://tkinter.unpythonic.net/wiki/TableListTil
> > eWrapper
> > http://tkinter.unpythonic.net/wiki/PyLocateTile
> > http://tkinter.unpythonic.net/wiki/PyLocate
> >
> > Hope these prove useful to others, as starting
> > points for your own work if nothing else.
> > Corrections and improvements are of course
> > invited; it's a wiki!
> >
> >
> > --
> > Kevin Walzer
> > Code by Kevin
> > http://www.codebykevin.com
> 
> From: Croteam <vedran at v-programs.com>
> To: python-list at python.org
> Subject: shtoom complicated install
> Date: 27 Nov 2006 09:35:55 -0800
> 
> 
> Hello,
> 
> I have install problem about shtoom.How to I Install shtoom
> correct,when I install shtoom
> with setup.py (shtoom package setup file), it just make some directory
> (shtoom-0.2) and
> 3 python files with them.But just tell me this,when I was manual make
> folder by name "shtoom" (as write in shtoom package setup file) and in
> that folder put folders: app,audio,multicast,ui ,now I must
> "insert" python files from shtoom package into that folders but I don't
> know where  I must put
> every file?? In what folder.
> 
> 
> 
>                           I will appreciate any help
> 
>                           Regards,Vedran
> 
> From: Edwin Gomez <edgomez at consultant.com>
> To: python-list at python.org
> Subject: Calling a thread asynchronously with a callback
> Date: Mon, 27 Nov 2006 12:44:46 -0500
> 
> 
> I'm a C# developer and I'm new to Python.  I would like to know if 
> the concept of Asynchronous call-backs exists in Python.  Basically 
> what I mean is that I dispatch a thread and when the thread 
> completes it invokes a method from the calling thread.  Sort event 
> driven concept with threads.
> 
> 
> Thanks.
> 
> Ed Gomez
> 
> From: Trent Mick <trentm at activestate.com>
> To: Steve Thompson <sthompson at creativewebnet.com>
> Cc: python-list at python.org
> Subject: Re: Active State and Komodo...
> Date: Mon, 27 Nov 2006 09:48:45 -0800
> 
> 
> Steve Thompson wrote:
> > Hello all,
> >
> > I was wondering the differnced there were betwee Active State's python and
> > the open source version of python.
> 
> Here is the best answer to that:
> http://groups.google.com/group/comp.lang.python/tree/browse_frm/thread/e8291fcb1418e80/16f39060f654402f?rnum=1&hl=en&q=ActivePython+trent&_done=%2Fgroup%2Fcomp.lang.python%2Fbrowse_frm%2Fthread%2Fe8291fcb1418e80%2F98c87a6a5dc8f3c0%3Ftvc%3D1%26q%3DActivePython+trent%26hl%3Den%26#doc_b6f732ab2c8434ef
> http://tinyurl.com/y7r47q
> 
> 
> > Would I have to unistall my opend souce
> > python?
> 
> No. As BartlebyScrivener wrote you shouldn't do that. You can 
> easily install ActivePython side-by-side with another Python 
> install on Linux.
> 
> 
>  > Additonally, how does Active State's Komodo IDE vs. the eric3 IDE
> > unler SuSE Linux v. 10.i?
> >
> > Addionally, is the eric IDE (version 3) an acceptible IDE or are there
> > more easy and more productive IDE's for perl?
> 
> *I* like Komodo, but then I am biased because I am one of its developers. :)
> I presume you meant Python instead of Perl there, but if not, 
> Komodo does support Perl as well as Python (and PHP, JavaScript, 
> Ruby, Tcl and XSLT too).
> 
> This is a pretty good review of Python IDEs (although note that 
> most, if not all, of the IDEs reviewed there will have advanced a 
> few versions).
> 
> http://spyced.blogspot.com/2005/09/review-of-6-python-ides.html
> 
> 
> Komodo 4 is currently under public beta (Komodo 4 beta 1 is out now 
> and beta 2 should be released later this week). Try it out:
> 
> http://www.activestate.com/products/komodo/beta.plex#features
> 
> 
> Cheers,
> Trent
> 
> -- Trent Mick
> trentm at activestate.com
> 
> From: halex2000 <powernews at libero.it>
> To: python-list at python.org
> Subject: Re: working with files and directories
> Date: Mon, 27 Nov 2006 18:01:20 GMT
> 
> 
> 
> "Duncan Booth" <duncan.booth at invalid.invalid> ha scritto nel messaggio
> news:Xns98888B8FD9B32duncanbooth at 127.0.0.1...
> > "halex2000" <powernews at libero.it> wrote:
> >> "Thomas Ploch" <Thomas.Ploch at gmx.net> ha scritto nel messaggio
> >> news:mailman.766.1164631069.32031.python-list at python.org...
> >>> Have you actually even tried to find some "documentation"?
> >>> Have you placed a google search "python directories rename files"?
> >>> Thomas
> >>
> >> Actually I did it on the documentation file provided with the windows
> >> distribution. I took a look at 11 ("File and Directory Access") but
> >> the listed functions doesn't appear to be what I need. 14.1.4 should
> >> do the job, but was not as intuitive to find as the previous one.
> >>
> > Do you know about the search tab in windows help? Searching for "rename
> > files", or indeed a search identical to the one suggested for Google will
> > both find 14.1.4 as the top hit.
> 
> I'm aware of it, thank you. I usually don't use to ask for infos that I
> could easily find myself in a few seconds, but I had not the time at the
> moment to even start a search (of course, If I knew it would have been so
> quick, I would have done it myself). I was just under the impression that I
> was looking in the wrong place.
> 
> From: Diez B. Roggisch <deets at nospam.web.de>
> To: python-list at python.org
> Subject: Re: Calling a thread asynchronously with a callback
> Date: Mon, 27 Nov 2006 19:07:34 +0100
> 
> 
> Edwin Gomez wrote:
> 
> > I'm a C# developer and I'm new to Python.  I would like to know if the
> > concept of Asynchronous call-backs exists in Python.  Basically what I
> > mean is that I dispatch a thread and when the thread completes it invokes
> > a method from the calling thread.  Sort event driven concept with threads.
> 
> Counter question: does such a thing exist in C#, and if, is it bound to some
> existing event loop?
> 
> I'm really curious, because having code being interrupted at any time by a
> asynchronous callback strikes me as dangerous. But then maybe I'm just a
> whimp :)
> 
> Diez
> 
> From: Bjoern Schliessmann <usenet-mail-0306.20.chr0n0ss at spamgourmet.com>
> To: python-list at python.org
> Subject: Re: Calling a thread asynchronously with a callback
> Date: Mon, 27 Nov 2006 19:11:56 +0100
> 
> 
> Edwin Gomez wrote:
> 
> > I'm a C# developer and I'm new to Python.  I would like to know if
> > the concept of Asynchronous call-backs exists in Python.
> 
> Sure. Either with this:
> 
> http://twistedmatrix.com/projects/core/documentation/howto/async.html
> 
> Or manually using select().
> 
> > Basically what I mean is that I dispatch a thread and when the
> > thread completes it invokes a method from the calling thread. 
> > Sort event driven concept with threads.
> 
> What you describe here isn't the only way to do asynchronous
> callbacks. See above for a simpler way.
> 
> Regards,
> 
> 
> Björn
> 
> --
> BOFH excuse #233:
> 
> TCP/IP UDP alarm threshold is set too low.
> 
> From: lisa.engblom at gmail.com
> To: python-list at python.org
> Subject: python skipping lines?
> Date: 27 Nov 2006 10:17:57 -0800
> 
> 
> Hi,
> 
> I've just started programming in python, and have run into an
> unexpected problem.  I am using python to pull text data from some csv
> files.  I have one file that has the important identifiers (name, etc)
> and other files with lots of other data.  I wrote a function that takes
> the file name and identifiers as inputs, selects the data I need, and
> outputs it to another file.  This function (PullData) seems to work
> fine.
> 
> In the same .py file, but separate from the function, I entered used
> "for line in file" to step through each line in my identifier file and
> feed the identifiers into my PullData function.  It works fine for the
> first entry in my identifier file, but it will not call the function
> again.  It will execute lines before or after the appropriate number of
> times given the number of lines in the identifier file.  i just put in
> a dummy counter variable to try to figure out why it wasn't working)
> ... but it always skips the function call after the first line.
> 
> Any ideas of what could be the problem?
> 
> From: ronrsr <ronrsr at gmail.com>
> To: python-list at python.org
> Subject: can't get cgi values
> Date: 27 Nov 2006 10:28:54 -0800
> 
> 
> I'm having trouble extracting cgi parameters in my code - this is a web
> application, so I only know the line that's causing the problem.
> 
> here's the info I know:
> 
> form = FieldStorage(None, None, [MiniFieldStorage('zid', '17'),
> MiniFieldStorage('keywords', 'aAUA'), MiniFieldStorage('keywords',
> 'aBOS'), MiniFieldStorage('citation', '<i>The Earth Times Monthly</i>,
> April 2002\\r\\n       \\r\\n       \r\n       '),
> MiniFieldStorage('quotation', 'Farm support goes mainly to a relatively
> small number of agri-businesses, many of them large corps. Yet these
> subsidies are 6 times what rich countries provide in foreign aid to a
> developing world that includes 5 billion people.\\r\\n       \r\n
> '), MiniFieldStorage('updatebutton', 'Update')])
> form.has_key("citation") = True
> 
> 
> 
>       fileHandle.write("here aer the haskeys");
>       fileHandle.write( str(form.has_key("citation")))
>      /* returns TRUE */
> 
>       temp = str(form("citation").value)
>           /* python stops here,
> 
>              form("citation appears to be undefined */
> 
> 
> 
>       print (str(form("citation").value))
>    /* this doesn't work, either */
> 
> 
> 
> 
>       if form.has_key("keywords"):                                  /*
> neither does this */
>           keywords = str(form["keywords"].value)
>       else:
>            keywords = "k"
> 
> 
> 
> 
> 
> 
> any ideas on what the problem is?
> 
> thank you so much.
> 
> -rsr-
> 
> From: Fredrik Lundh <fredrik at pythonware.com>
> To: python-list at python.org
> Subject: Re: can't get cgi values
> Date: Mon, 27 Nov 2006 19:40:36 +0100
> 
> 
> ronrsr wrote:
> 
> > I'm having trouble extracting cgi parameters in my code - this is a web
> > application, so I only know the line that's causing the problem.
> 
> seen this:
> 
>      http://docs.python.org/lib/module-cgitb.html
> 
> ?
> 
> >      temp = str(form("citation").value)
> 
> did you perhaps mean form["citation"] ?
> 
> </F>
> 
> From: Paul McGuire <ptmcg at austin.rr._bogus_.com>
> To: python-list at python.org
> Subject: Re: can't get cgi values
> Date: Mon, 27 Nov 2006 18:41:23 GMT
> 
> 
> form("citation").value
> 
> Is form some form of dict?  If so, then this should be something like:
> 
> form["citation"]
> 
> If not, then maybe value is a function, requiring ()'s to actually invoke
> it.
> 
> -- Paul
> 
> --
> http://mail.python.org/mailman/listinfo/python-list

>




More information about the Python-list mailing list