[Tutor] please give me feedback - linux & virtual machine python script

2012-11-03 Thread pygods
Hi, This script helps load files with the corresponding application inside a virtual machine from the host file manager. The script is accessed by right clinking the file from Nautilus file manager (Linux/Gnome/Ubuntu Unity) in the host. For the Nautilus script menu to work, the file openinvm.py n

Re: [Tutor] running multiple concurrent processes

2012-11-03 Thread wrw
On Nov 3, 2012, at 9:36 PM, Oscar Benjamin wrote: > [byte] > >> >> Bill, I appreciate your comment and have given it much thought, Ramit made >> one much the same the other day. Here lies the potential problem, though it >> might not be one at all, I need to do some experimenting. While I am

Re: [Tutor] running multiple concurrent processes

2012-11-03 Thread Mark Lawrence
On 04/11/2012 01:05, richard kappler wrote: I notice no one has mentioned asyncore. Is that something I should stay away from? I just started digging through the doc file. regards, Richard If you're really interested read the thread "The Async API of the future" and its derivatives on the Py

Re: [Tutor] running multiple concurrent processes

2012-11-03 Thread Devin Jeanpierre
On Sat, Nov 3, 2012 at 9:05 PM, richard kappler wrote: > I notice no one has mentioned asyncore. Is that something I should stay away > from? I just started digging through the doc file. Regardless of ones' feelings on it, there is no builtin support for multiprocessing using asyncore. -- Devin

Re: [Tutor] running multiple concurrent processes

2012-11-03 Thread richard kappler
>I didn't really understand the above. Is 'manager' some kind of library? > > http://docs.python.org/2/library/multiprocessing.html#managers > > > >Who's Bill? Alan was referring to Twisted that is an event driven > >framework. Event driven or asynchronous processing is a third option > >(after thr

Re: [Tutor] running multiple concurrent processes

2012-11-03 Thread Oscar Benjamin
On 4 November 2012 01:05, richard kappler wrote: > I notice no one has mentioned asyncore. Is that something I should stay away > from? I just started digging through the doc file. I've only briefly looked at asyncore. I've never heard anyone recommend it: the recommendations for asynchronous pro

Re: [Tutor] running multiple concurrent processes

2012-11-03 Thread Oscar Benjamin
On 4 November 2012 01:03, richard kappler wrote: > Oscar, that was positively brilliant! Now I get it, I understand how to do > it, and I think this has rearranged my entire plan for the "MCP." If the MCP > is basically just a program that calls several other programs(processes) and > does that bi

Re: [Tutor] running multiple concurrent processes

2012-11-03 Thread richard kappler
I notice no one has mentioned asyncore. Is that something I should stay away from? I just started digging through the doc file. regards, Richard -- quando omni flunkus moritati ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscript

Re: [Tutor] running multiple concurrent processes

2012-11-03 Thread richard kappler
Oscar, that was positively brilliant! Now I get it, I understand how to do it, and I think this has rearranged my entire plan for the "MCP." If the MCP is basically just a program that calls several other programs(processes) and does that bit of coordination between each, then my life just got meas

Re: [Tutor] running multiple concurrent processes

2012-11-03 Thread Alan Gauld
On 03/11/12 22:49, Alan Gauld wrote: That's another common pattern - especially in old COOL mainframes! Given my background that may have been a Freudian slip but I did mean COBOL! honest! :-) -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ __

Re: [Tutor] running multiple concurrent processes

2012-11-03 Thread Alan Gauld
On 03/11/12 20:20, richard kappler wrote: SO... while the bot program is running, I would like it to be continuously cognizant of the sensor data and any changes in that data. Let's distill it down to a single sensor to simplify the discussion. If I have a temperature sensor feeding data to the

Re: [Tutor] running multiple concurrent processes

2012-11-03 Thread eryksun
On Sat, Nov 3, 2012 at 5:59 PM, Oscar Benjamin wrote: > > how_many_spams = Value('i', 1) > > p1 = Process(target=update_brain) > p2 = Process(target=chat_with_friends) > > p1.start() > p2.start() In Linux you can easily inherit the global Value object in forked processes, but it's not that hard t

Re: [Tutor] running multiple concurrent processes

2012-11-03 Thread Oscar Benjamin
On 3 November 2012 20:20, richard kappler wrote: > To all, especially Dave, Oscar and Ramit, thanks for the discussion and > help. Tino, as soon as I have something to put up, I will gladly put it up > on Github. At the moment I only have a few snippets I've written in trying > to learn the variou

Re: [Tutor] running multiple concurrent processes

2012-11-03 Thread richard kappler
To all, especially Dave, Oscar and Ramit, thanks for the discussion and help. Tino, as soon as I have something to put up, I will gladly put it up on Github. At the moment I only have a few snippets I've written in trying to learn the various bits everyone has been helping me with. Just for the re

Re: [Tutor] how to keep track of sorted lists

2012-11-03 Thread Steven D'Aprano
On 04/11/12 01:40, Albert-Jan Roskam wrote: Hi, sorry about that. Here's a copy/pastable version. I also added a 'data' parameter as my original code was too synthetic in this respect. The more realistically, the data come from some getter method. I don't understand what you mean by that. i

Re: [Tutor] how to keep track of sorted lists

2012-11-03 Thread Steven D'Aprano
On 04/11/12 00:04, Albert-Jan Roskam wrote: Hello, I want to make a get() method that uses a binary search. This requires the data to be sorted which is an expensive operation, so I would like to do this no more often than needed. Reset your intuition. Sorting an almost-sorted list with Timso

Re: [Tutor] how to keep track of sorted lists

2012-11-03 Thread Dave Angel
On 11/03/2012 10:40 AM, Albert-Jan Roskam wrote: >> On 11/03/2012 09:04 AM, Albert-Jan Roskam wrote: > >>> Hello, >> >> (I haven't run the code, as it was not presented in a form that I could >> do a single copy/paste. So I may have missed some subtlety in the code.) > > Hi, sorry about that. H

Re: [Tutor] how to keep track of sorted lists

2012-11-03 Thread Albert-Jan Roskam
> On 11/03/2012 09:04 AM, Albert-Jan Roskam wrote: >> Hello, > > (I haven't run the code, as it was not presented in a form that I could > do a single copy/paste.  So I may have missed some subtlety in the code.) Hi, sorry about that. Here's a copy/pastable version. I also added a 'data' param

Re: [Tutor] how to keep track of sorted lists

2012-11-03 Thread Dave Angel
On 11/03/2012 09:04 AM, Albert-Jan Roskam wrote: > Hello, (I haven't run the code, as it was not presented in a form that I could do a single copy/paste. So I may have missed some subtlety in the code.) > I want to make a get() method that uses a binary search. This requires the > data to be so

[Tutor] how to keep track of sorted lists

2012-11-03 Thread Albert-Jan Roskam
Hello, I want to make a get() method that uses a binary search. This requires the data to be sorted which is an expensive operation, so I would like to do this no more often than needed. Which of the to classes below is the best way to keep track of the sorted lists? TestOne stores them in sepa