Re: multithreading

2012-04-07 Thread Adam Skutt
On Apr 7, 5:06 pm, Kiuhnm wrote: > On 4/7/2012 22:09, Bryan wrote:>> For instance, let's say I want to make this > code thread-safe: > > >> ---> > >> myDict = {} > > >> def f(name, val): > >>       if name not in myDict: > >>           myDict[name] = val > >>       return myDict[name] > >> <--- >

Re: Interrupting a blocking function frolm another thread.

2012-04-08 Thread Adam Skutt
On Apr 8, 2:45 pm, "superhac...@gmail.com" wrote: > I am using the python module nfqueue-bindings which is a nfqueue > packet intercepting module.  It uses the following snippet of code to > start the process: > > print "trying to run" > try: >      q.try_run() >      except KeyboardInterrupt, e:

Re: Interrupting a blocking function frolm another thread.

2012-04-08 Thread Adam Skutt
On Apr 8, 5:52 pm, superhac...@gmail.com wrote: > On Sunday, April 8, 2012 3:55:41 PM UTC-5, Adam Skutt wrote: > > On Apr 8, 2:45 pm, "superhac...@gmail.com" > > wrote: > > > I am using the python module nfqueue-bindings which is a nfqueue > > > packet

Re: Python randomly exits with Linux OS error -9 or -15

2012-04-09 Thread Adam Skutt
On Apr 9, 6:47 am, Alain Ketterlin wrote: > Janis writes: > > I have this problem with my script exiting randomly with Linux OS > > status code -9 (most often) or -15 (also sometimes, but much more > > rarely). As far as I understand -9 corresponds to Bad file descriptor > > and -15 Block device

Re: Python randomly exits with Linux OS error -9 or -15

2012-04-09 Thread Adam Skutt
On Apr 9, 6:01 am, Janis wrote: > Hello! > > I have this problem with my script exiting randomly with Linux OS > status code -9 (most often) or -15 (also sometimes, but much more > rarely). As far as I understand -9 corresponds to Bad file descriptor > and -15 Block device required. > As Alain al

Re: system call that is killed after n seconds if not finished

2012-04-17 Thread Adam Skutt
On Apr 16, 11:34 am, Alain Ketterlin wrote: > Jaroslav Dobrek writes: > > I would like to execute shell commands, but only if their execution > > time is not longer than n seconds. Like so: > > > monitor(os.system("do_something"), 5) > > > I.e. the command do_somthing should be executed by the op

Re: os.system()

2012-04-20 Thread Adam Skutt
On Apr 20, 6:51 am, Yigit Turgut wrote: > On Apr 19, 11:02 pm, "Steve" wrote: > > > > "Yigit Turgut" wrote in message > > >news:b9a8bb28-3003-4a36-86fb-339ef697b...@i2g2000vbd.googlegroups.com... > > > When I use os.system() function, script waits for termination of the > > > windows that is ope

Re: why () is () and [] is [] work in other way?

2012-04-25 Thread Adam Skutt
On Apr 25, 10:38 am, Nobody wrote: > On Mon, 23 Apr 2012 10:01:24 -0700, Paul Rubin wrote: > >> I can't think of a single case where 'is' is ill-defined. > > > If I can't predict the output of > > >     print (20+30 is 30+20)  # check whether addition is commutative print > >     (20*30 is 30*20)

Re: why () is () and [] is [] work in other way?

2012-04-25 Thread Adam Skutt
On Apr 25, 8:01 pm, Steven D'Aprano wrote: > On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote: > > Though, maybe it's better to use a different keyword than 'is' though, > > due to the plain English > > connotations of the term; I like 'sameobj&#

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 5:10 am, Steven D'Aprano wrote: > On Wed, 25 Apr 2012 20:50:21 -0700, Adam Skutt wrote: > > On Apr 25, 8:01 pm, Steven D'Aprano > +comp.lang.pyt...@pearwood.info> wrote: > >> On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote: > >> >

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 1:48 am, John Nagle wrote: > On 4/25/2012 5:01 PM, Steven D'Aprano wrote: > > > On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote: > > >> Though, maybe it's better to use a different keyword than 'is' though, > >> due to th

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 9:37 am, Kiuhnm wrote: > On 4/26/2012 13:45, Adam Skutt wrote: > > > > > > > > > > > On Apr 26, 1:48 am, John Nagle  wrote: > >> On 4/25/2012 5:01 PM, Steven D'Aprano wrote: > > >>> On Wed, 25 Apr 2012 13:49:24 -07

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 10:18 am, rusi wrote: > On Apr 26, 4:42 pm, Adam Skutt wrote: > > > > > In a mathematical sense, you're saying that given f(x) = x+2, using > > f(x) is somehow more "direct" (whatever the hell that even means) than > > using '

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 12:02 pm, Kiuhnm wrote: > On 4/26/2012 16:00, Adam Skutt wrote: > > On Apr 26, 9:37 am, Kiuhnm wrote: > >> On 4/26/2012 13:45, Adam Skutt wrote: > > >>> On Apr 26, 1:48 am, John Naglewrote: > >>>> This assumes that everythin

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 1:34 pm, rusi wrote: > On Apr 26, 7:44 pm, Adam Skutt wrote: > > On Apr 26, 10:18 am, rusi wrote: > > > > On Apr 26, 4:42 pm, Adam Skutt wrote: > > > > > In a mathematical sense, you're saying that given f(x) = x+2, using > > > >

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 2:31 pm, John Nagle wrote: > On 4/26/2012 4:45 AM, Adam Skutt wrote: > > On Apr 26, 1:48 am, John Nagle  wrote: > >> On 4/25/2012 5:01 PM, Steven D'Aprano wrote: > > >>> On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote: > > >>>&

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 6:34 pm, Kiuhnm wrote: > On 4/26/2012 20:54, Adam Skutt wrote: > > On Apr 26, 12:02 pm, Kiuhnm  wrote: > >> On 4/26/2012 16:00, Adam Skutt wrote: > >>> On Apr 26, 9:37 am, Kiuhnm   wrote: > >> The fact that you think that that's "differ

Re: Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Thu, Apr 26, 2012 at 12:05 PM, Evan Driscoll wrote: > This thread has already beaten a dead horse enough that the horse came back > as a zombie and was re-killed, but I couldn't help but respond to this part: > > > On 01/-10/-28163 01:59 PM, Adam Skutt wrote: >>

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Thu, Apr 26, 2012 at 5:39 PM, Ian Kelly wrote: > On Thu, Apr 26, 2012 at 1:34 PM, Adam Skutt wrote: >> What I think you want is what I said above: ValueError raised when >> either operand is a /temporary/ object.  Really, it should probably be >> a parse-time error,

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 7:33 pm, Steven D'Aprano wrote: > On Thu, 26 Apr 2012 12:22:55 -0700, Adam Skutt wrote: > > I often wonder what the world would be like if Python, C#, and Java > > embraced value types more, and had better support for pure functions. > > They would be s

Re: why () is () and [] is [] work in other way?

2012-04-27 Thread Adam Skutt
On Apr 26, 10:56 pm, "OKB (not okblacke)" wrote: > Adam Skutt wrote: > > If I write a function that does a value comparison, then it should > > do value comparison on _every type that can be passed to it_, > > regardless of whether the type is a primitive or an obje

Re: why () is () and [] is [] work in other way?

2012-04-27 Thread Adam Skutt
On Apr 27, 8:07 am, Kiuhnm wrote: > Useful... maybe, conceptually sound... no. > Conceptually, NaN is the class of all elements which are not numbers, > therefore NaN = NaN. NaN isn't really the class of all elements which aren't numbers. NaN is the result of a few specific IEEE 754 operations t

Re: why () is () and [] is [] work in other way?

2012-04-27 Thread Adam Skutt
On Apr 27, 11:01 am, Kiuhnm wrote: > On 4/27/2012 1:57, Adam Skutt wrote: > > On Apr 26, 6:34 pm, Kiuhnm  wrote: > >>> If you > >> understand that your 'a' is not really an object but a reference to it, > >> everything becomes clear and you

Re: Borg identity [was Re: why () is () and [] is [] work in other way?]

2012-04-27 Thread Adam Skutt
On Apr 27, 12:56 pm, Steven D'Aprano wrote: > On Thu, 26 Apr 2012 04:42:36 -0700, Adam Skutt wrote: > > You're going to have to explain the value of an "ID" that's not 1:1 with > > an object's identity, for at least the object's lifecycle, for a &

Re: Python id() does not return an address [was Re: why () is () and [] is [] work in other way?]

2012-04-27 Thread Adam Skutt
On Apr 27, 1:12 pm, Steven D'Aprano wrote: > On Thu, 26 Apr 2012 04:42:36 -0700, Adam Skutt wrote: > > On Apr 26, 5:10 am, Steven D'Aprano > +comp.lang.pyt...@pearwood.info> wrote: > >> Solution to *what problem*? > > > This confusion that many

Re: Direct vs indirect [was Re: why () is () and [] is [] work in other way?]

2012-04-27 Thread Adam Skutt
On Apr 27, 1:06 pm, Steven D'Aprano wrote: > On Thu, 26 Apr 2012 04:42:36 -0700, Adam Skutt wrote: > > On Apr 26, 5:10 am, Steven D'Aprano > +comp.lang.pyt...@pearwood.info> wrote: > >> But I was actually referring to something more fundamental than that. > &

Re: Borg identity [was Re: why () is () and [] is [] work in other way?]

2012-04-27 Thread Adam Skutt
On Apr 27, 2:40 pm, Steven D'Aprano wrote: > On Fri, 27 Apr 2012 10:33:34 -0700, Adam Skutt wrote: > >> Why should the caller care whether they are dealing with a singleton > >> object or an unspecified number of Borg objects all sharing state? A > >> clev

Re: CPython thread starvation

2012-04-27 Thread Adam Skutt
On Apr 27, 2:54 pm, John Nagle wrote: >      I have a multi-threaded CPython program, which has up to four > threads.  One thread is simply a wait loop monitoring the other > three and waiting for them to finish, so it can give them more > work to do.  When the work threads, which read web pages a

Re: why () is () and [] is [] work in other way?

2012-04-28 Thread Adam Skutt
On Apr 28, 7:26 am, Kiuhnm wrote: > On 4/27/2012 19:15, Adam Skutt wrote: > > On Apr 27, 11:01 am, Kiuhnm  wrote: > >> The abstraction is this: > >> - There are primitives and objects. > >> - Primitives are not objects. The converse is also true. > >

Re: How can I read streaming output of a subprocess

2012-05-02 Thread Adam Skutt
On May 2, 7:46 am, Kiuhnm wrote: > On 5/2/2012 13:08, Damjan Georgievski wrote: > > > I want to read the stream of an external process that I start with > > Python. From what I've seen that's not possible with the subprocess module? > > Try with >     cmd = 'your command here' >     stdout = Popen

Re: How to get outer class name from an inner class?

2012-05-09 Thread Adam Skutt
On May 8, 4:05 pm, John Gordon wrote: > I'm trying to come up with a scheme for organizing exceptions in > my application. > > Currently, I'm using a base class which knows how to look up the text > of a specific error in a database table, keyed on the error class name. > > The base class looks li

Re: Alternative to subprocess in order to not wait for calling commands to complete

2012-05-14 Thread Adam Skutt
On May 10, 12:07 pm, ks wrote: > Hi All, > > From within one Python program, I would like to invoke three other > Python programs. Usually I would use the subprocess module to invoke > these sequentially. I now have a use case in which I must invoke the > first one (not wait for it to complete), t

Re: parallel subprocess.getoutput

2012-05-14 Thread Adam Skutt
On May 11, 8:04 am, Jaroslav Dobrek wrote: > Hello, > > I wrote the following code for using egrep on many large files: > > MY_DIR = '/my/path/to/dir' > FILES = os.listdir(MY_DIR) > > def grep(regex): >     i = 0 >     l = len(FILES) >     output = [] >     while i < l: >         command = "egrep

Re: How to get number of bytes written to nonblocking FIFO when EAGAIN is raised?

2011-07-19 Thread Adam Skutt
On Jul 19, 9:19 pm, Aaron Staley wrote: > However, if interpreter 1 overfills the FIFO, we get an error (EAGAIN)>>> > f.write('a'*7) > > IOError: [Errno 11] Resource temporarily unavailable > > However interpreter 2 still receives data>> len(f.read()) > > 65536 > > It looks like interpreter 1

Re: Why __slots__ slows down attribute access?

2011-08-23 Thread Adam Skutt
On Aug 23, 5:48 am, Jack wrote: > People have illusion that it is faster to visit the attribute defined > by __slots__ > .http://groups.google.com/group/comp.lang.python/msg/c4e413c3d86d80be > > That is wrong. The following tests show it is slower. No, they don't really show anything. The defau

Re: Python thread

2011-09-01 Thread Adam Skutt
On Sep 1, 5:54 pm, Terry Reedy wrote: > > Does it mean that python threads are not mapped to the core in the system. > > They all run on the same core. > No, CPython is a native thread implementation, so they'll be scheduled however the kernel sees fit. Only allowing one thread to run at a time

Re: Python thread

2011-09-01 Thread Adam Skutt
On Sep 1, 5:14 pm, George wrote: > Hi, > Why doesn't python threads show an associated PID?  On spawning python > threads using the threading module I can only see the main thread's pid on > using top or ps unix command, no  subprocesses are displayed. In otherwords > top or ps in not aware of any

Re: Why doesn't threading.join() return a value?

2011-09-02 Thread Adam Skutt
On Sep 2, 10:53 am, Roy Smith wrote: > I have a function I want to run in a thread and return a value.  It > seems like the most obvious way to do this is to have my target > function return the value, the Thread object stash that someplace, and > return it as the return value for join(). > > Yes,

Re: Why doesn't threading.join() return a value?

2011-09-02 Thread Adam Skutt
On Sep 2, 2:23 pm, Alain Ketterlin wrote: > Sorry, you're wrong, at least for POSIX threads: > > void pthread_exit(void *value_ptr); > int pthread_join(pthread_t thread, void **value_ptr); > > pthread_exit can pass anything, and that value will be retrieved with > pthread_join. No, it can only pa

Re: Why doesn't threading.join() return a value?

2011-09-02 Thread Adam Skutt
On Sep 2, 4:14 pm, Chris Torek wrote: > In article > Adam Skutt   wrote: > > >No, it can only pass a void*, which isn't much better than passing an > >int. > > It is far better than passing an int, although it leaves you with > an annoying storage-management

Re: Avoid race condition with Popen.send_signal

2012-01-02 Thread Adam Skutt
On Jan 2, 6:09 pm, Jérôme wrote: > Hi all. > > When a subprocess is running, it can be sent a signal with the send_signal > method : > > process = Popen( args) > process.send_signal(signal.SIGINT) > > If the SIGINT is sent while the process has already finished, an error is > raised : > >   File "

Re: Avoid race condition with Popen.send_signal

2012-01-02 Thread Adam Skutt
On Jan 2, 8:44 pm, Cameron Simpson wrote: > On 02Jan2012 20:31, Devin Jeanpierre wrote: > | > I think that catching the exception is probably the most Pythonic way. > | > | It's the only correct way. > > Indeed, but be precise - chek that it _is_ error 3, or more portably, > errno.ESRCH. POSIX pr

Re: Avoid race condition with Popen.send_signal

2012-01-03 Thread Adam Skutt
On Jan 3, 7:31 am, Heiko Wundram wrote: > Am 03.01.2012 02:19, schrieb Adam Skutt: > > > On Jan 2, 6:09 pm, Jérôme  wrote: > >> What is the clean way to avoid this race condition ? > > > The fundamental race condition cannot be removed nor avoided. Ideally,

Re: Avoid race condition with Popen.send_signal

2012-01-03 Thread Adam Skutt
On Jan 3, 3:44 am, Jérôme wrote: > Mon, 2 Jan 2012 19:16:50 -0800 (PST) > Adam Skutt a écrit: > > > No. It is possible (however unlikely) for EPERM to be legitimately > > returned in this case.  Anything other than EINVAL should be > > interpreted as "The child

Re: Avoid race condition with Popen.send_signal

2012-01-03 Thread Adam Skutt
On Jan 3, 3:58 am, Chris Angelico wrote: > On Tue, Jan 3, 2012 at 7:44 PM, Jérôme wrote: > > If so, I don't see how I can protect myself from that. Checking the process > > is alive and then hoping that the time interval for the race condition is so > > small that there are few chances for that t

Re: Avoid race condition with Popen.send_signal

2012-01-03 Thread Adam Skutt
On Jan 2, 11:53 pm, Cameron Simpson wrote: > On 02Jan2012 19:16, Adam Skutt wrote: > | On Jan 2, 8:44 pm, Cameron Simpson wrote: > | > On 02Jan2012 20:31, Devin Jeanpierre wrote: > | > | > I think that catching the exception is probably the most Pythonic way. > | &

Re: Avoid race condition with Popen.send_signal

2012-01-03 Thread Adam Skutt
On Jan 3, 4:38 am, Jérôme wrote: > I have an application that can spawn a subprocess to play a beep. I want it > to kill the subprocess when exiting. Why? You shouldn't need to send a signal to tell the process to terminate: it should terminate when its stdin is closed or when it's done playing

Re: Avoid race condition with Popen.send_signal

2012-01-03 Thread Adam Skutt
On Jan 3, 10:09 am, Jérôme wrote: > Tue, 3 Jan 2012 06:12:59 -0800 (PST) > Adam Skutt a écrit: > > > The conservative approach is to use another IPC mechanism to talk to > > the process, such as a pipe or a socket.  Why are you trying to send > > the child proces

Re: Tkinter: The good, the bad, and the ugly!

2010-12-30 Thread Adam Skutt
On Dec 29, 7:48 pm, "Octavian Rasnita" wrote: > First, the interface should look exactly as the native interfaces for each > system named, and it should provide the same features, because otherwise the > interface would look strange for all the users on all the operating systems. > And of course

Re: Tkinter: The good, the bad, and the ugly!

2010-12-30 Thread Adam Skutt
On Dec 30, 11:24 pm, rantingrick wrote: > > > The problem with wx is that it is BIG.  And so if we want something like > > wx to be in the stdlib then it would have to be refactored so that there > > was a small basic wx that was part of stdlib and then import > > wx-the-whole-enchilada if you nee

Re: Tkinter: The good, the bad, and the ugly!

2010-12-31 Thread Adam Skutt
On Dec 31, 12:21 am, rantingrick wrote: > Of course a tiny widget set like this is not going to handle extensive > GUI coding, thats a no brainer. No, it's not going to handle any GUI coding except notepad.exe. That's already been written, so we're left with no new application that can be writte

Re: Nagios

2010-12-31 Thread Adam Skutt
On Friday, December 31, 2010 9:56:02 PM UTC-5, Robert H wrote: > It was forked to be written in Python, yes. The whole point (and it > wasn't a Nagios port to Tcl) was that the Tcl community (and I like the > Tcl community a lot) has a strange fixation with not reinventing the > wheel, even when

Re: Nagios

2011-01-01 Thread Adam Skutt
On Saturday, January 1, 2011 10:00:06 AM UTC-5, Robert H wrote: > > Right, just because you say it paints me in a negative light. Look at > every language out there and look within the groups. Everyone is trying > to revinvent the wheel to (in their view) make it better. "Everyone" is doing not

Re: Tkinter: The good, the bad, and the ugly!

2011-01-01 Thread Adam Skutt
On Jan 1, 5:03 pm, rantingrick wrote: > I actually like Tkinter's simplistic API. I especially love Tkinter > geometry management! However i realize that TclTk is lacking and > because of that fact we will always be at the mercy of another > community. This bothers me, and it should also bother y

Re: Nagios

2011-01-01 Thread Adam Skutt
On Jan 1, 6:21 pm, Robert wrote: > > Really? How many templating systems does Python have? More than one? > Why is that? How many web frameworks does Perl have? More than one? Why > is that? > > Why *was* Nagios forked and re-written in Python? > > There are too many examples to count. > You're m

Re: Interrput a thread

2011-01-03 Thread Adam Skutt
On Jan 3, 4:06 pm, Jean-Paul Calderone wrote: > > > Multiple processes, ok, but then regarding processes' interruption > > there will be the same problems pointed out by using threads? > > No.  Processes can be terminated easily on all major platforms.  See > `os.kill`. > Yes, but that's not the

Re: Interrput a thread

2011-01-03 Thread Adam Skutt
On Jan 3, 5:05 pm, gervaz wrote: > Regarding the case pointed out by Adam I think the best way to > deal with it is to create a critical section so that the shared memory > will be updated in an atomic fashion. Ok, so if the OS kills the process between taking the lock and releasing it, what are

Re: Interrput a thread

2011-01-03 Thread Adam Skutt
On Jan 3, 5:24 pm, Jean-Paul Calderone wrote: > Of course.  The whole point here is not about threads vs processes. > It's about shared memory concurrency vs non-shared memory > concurrency.  You can implement both with threads and both with > processes, but threads are geared towards shared memor

Re: Interrput a thread

2011-01-04 Thread Adam Skutt
On Jan 4, 10:12 am, Fuzzyman wrote: > > This is a case that .NET (C#) handles better than Python or Java. > Nope, read the documentation for Thread.Abort() carefully. Thread.Abort() can cause termination inside a static constructor, which is very bad. You sure your application can cope with that

Re: Interrput a thread

2011-01-05 Thread Adam Skutt
On Jan 4, 10:53 pm, John Nagle wrote: >      There are systems where there's support designed in for thread > abort.  LISP/Scheme systems tend to support it.  QNX, the real-time > OS, has well worked out thread-abort semantics at the C level. > (QNX has really good features for "not getting stuck"

Re: os.path.realpath() and os.path.abspath()

2011-01-11 Thread Adam Skutt
On Jan 11, 6:35 am, Jurko Gospodnetić wrote: >    Hi all. > >    os.path.realpath() documentation states that it returns a 'canonical' > path. Does that infer that it returns an absolute path? > A canonical path is supposed to be absolute and at least Python 2.7.1 ensures that is the case. Histo

Re: Tkinter: The good, the bad, and the ugly!

2011-01-16 Thread Adam Skutt
On Jan 14, 5:17 pm, Albert van der Horst wrote: > > I really don't follow that. You need a tremendous set to write gimp. > Obviously you won't write gimp in Python. > You need a tremendous set to write /the majority of the applications on your computer/. On my desktop right now, I have running:

Re: Tkinter: The good, the bad, and the ugly!

2011-01-16 Thread Adam Skutt
On Jan 16, 11:30 am, rantingrick wrote: > Adam your post is so incoherent that i cannot decide if you are FOR or > AGAINST changing the current Tkinter GUI module into a wxPython GUI > module. And this widget set that you keep referring to is a bit vague > also. If you found my post incoherent t

Re: Tkinter: The good, the bad, and the ugly!

2011-01-16 Thread Adam Skutt
On Jan 16, 6:04 pm, Steven D'Aprano wrote: > > If the situation isn't > > the same on your computer then your application usage is highly unusual > > or you don't understand what widgets are used to construct your > > applications.  You've just told me that Python would no longer be > > suitable f

Re: Tkinter: The good, the bad, and the ugly!

2011-01-16 Thread Adam Skutt
On Jan 16, 2:17 pm, rantingrick wrote: > The IDLE library has had a NoteBook widget for ages. They just choose > to call it TabPages instead. And what is a NoteBook exactly? Well a > Notebook is a compound widget consisting of a "main frame that holds > two sub frames -- which are a "tab" frame an

Re: examples of realistic multiprocessing usage?

2011-01-16 Thread Adam Skutt
On Jan 16, 2:05 pm, TomF wrote: > Instead of explaining my problem and asking for design suggestions, > I'll ask: is there a compendium of realistic Python multiprocessing > examples somewhere?  Or an open source project to look at? There are tons, but without even a knowledge domain, it's diffic

Re: examples of realistic multiprocessing usage?

2011-01-16 Thread Adam Skutt
On Jan 16, 11:39 pm, TomF wrote: > One difficulty is that there is a queue of work to be done and a queue > of results to be incorporated back into the parent; there is no > one-to-one correspondence between the two.  It's not obvious to me how > to coordinate the queues in a natural way to avoid

Re: examples of realistic multiprocessing usage?

2011-01-17 Thread Adam Skutt
On Jan 17, 12:44 am, TomF wrote: > Thanks for your reply.  I can enqueue all the jobs before waiting for > the results, it's just that I want the parent to process the results as > they come back.  I don't want the parent to block until all results are > returned.  I was hoping the Pool module had

Re: Tkinter: Joking?

2011-01-17 Thread Adam Skutt
On Jan 17, 3:30 am, Steven Howe wrote: > Target your market. Design your software in the Model-View-Controller > format. It becomes easy to configure you frontend, your GUI, your web > page, if your code is written to separate the work from the glitz. > If there were some evidence MVC actually wo

Re: Tkinter: The good, the bad, and the ugly!

2011-01-17 Thread Adam Skutt
On Jan 17, 8:30 am, Albert van der Horst wrote: > We are not talking about running applications, but about writing > applications. Someone has to write the applications I run... > I count 4000+ .py files in my /usr/share alone on Ubuntu. > Your set is totally unrepresentative for those scripts.

Re: Tkinter: The good, the bad, and the ugly!

2011-01-17 Thread Adam Skutt
On Jan 17, 11:01 am, Steven D'Aprano wrote: > > I'm afraid that's precisely what I'm arguing you *can't* do -- there's > nothing reasonable about equating the standard library with the language. > Some languages don't even have a standard library, or for that matter a > standard implementation. A

Re: Tkinter: The good, the bad, and the ugly!

2011-01-17 Thread Adam Skutt
On Jan 17, 3:08 pm, "Octavian Rasnita" wrote: >> From: "Adam Skutt" >> And we're not discussing those languages, we're discussing Python, >> which has an explicit policy of "batteries included".  As such, >> criticism of the st

Re: Tkinter: The good, the bad, and the ugly!

2011-01-18 Thread Adam Skutt
On Jan 18, 3:49 am, "Octavian Rasnita" wrote: > From: "Adam Skutt" > Subject: Re: Tkinter: The good, the bad, and the ugly! > > On Jan 17, 3:08 pm, "Octavian Rasnita" wrote: > > "Batteries included"? > > > Python doesn't

Re: Tkinter: The good, the bad, and the ugly!

2011-01-18 Thread Adam Skutt
On Jan 18, 8:09 am, Arndt Roger Schneider wrote: > Back to rantingrick 21st century toolkit/framwork: > Let's have a look at the numbers: > Worlwide pc market are 300 Million pcs per year, > this number includes desktops(2/3) and servers(1/3). > Your gui app is not relevant on servers. You should

Re: Tkinter: The good, the bad, and the ugly!

2011-01-18 Thread Adam Skutt
On Jan 18, 2:11 pm, rantingrick wrote: > Adam now you are making sense. Everything you said here is true. > This > is why we must push for the OpenGUI standard. Funny, I write considerable detail about why such a thing is a pipedream and useless even if it came to fruition, and you somehow belie

Re: Tkinter: The good, the bad, and the ugly!

2011-01-18 Thread Adam Skutt
On Jan 18, 3:20 pm, Arndt Roger Schneider wrote: > There has been no advancement in GUI-Design. Today it looks and > behaves just the way Bill Atkinson designed it. That doesn't even begin to equate to a lack of advancement. It's also not true in the least. > Technical revolutions are made by d

Re: Tkinter: The good, the bad, and the ugly!

2011-01-18 Thread Adam Skutt
On Jan 18, 4:45 pm, Arndt Roger Schneider wrote: > Adam Skutt schrieb: > > Until we have pixel-perfect touch sensors, toolkits for devices with > > pointer interfaces (e.g., PCs) and toolkits for devices with touch > > interfaces (e.g., phones and tablets) will necessarily be

Re: Tkinter: The good, the bad, and the ugly!

2011-01-18 Thread Adam Skutt
On Jan 18, 6:36 pm, rantingrick wrote: On Jan 18, 4:57 pm, Adam Skutt wrote: > On Jan 18, 4:45 pm, Arndt Roger Schneider > > > E.g. a button is: > > > A function gets asychnronously performed in response to > > > a finger/mouse click and release inside a certain sc

Re: Tkinter: The good, the bad, and the ugly!

2011-01-18 Thread Adam Skutt
On Jan 18, 8:59 pm, Corey Richardson wrote: > > > I completely agree! And we should expect it to be even better! > > What out there is there that meets those requirements? Nothing, and I somewhat doubt there ever will be. Tk is somewhat of an anomaly at this point. Most of the trend in GUI tool

Re: Tkinter: The good, the bad, and the ugly!

2011-01-18 Thread Adam Skutt
On Jan 18, 9:27 pm, Corey Richardson wrote: > > Why would you add in only a part of wxPython, instead of all of it? Is > the work to cut it down really an advantage over the size of the full > toolkit? From what I just checked, the source tarball is 40MB. Can that > much really be added to the Pyt

Re: Tkinter: The good, the bad, and the ugly!

2011-01-19 Thread Adam Skutt
On Jan 18, 3:23 pm, "Octavian Rasnita" wrote: > From: "Alexander Kapps" > > > Tkinter causes damage? Very bad damage? What are you talking about? > > I am talking about the fact that Python promotes Tkinter, and many beginners > will start using it, and they will start creating applications with

Re: Tkinter: The good, the bad, and the ugly!

2011-01-19 Thread Adam Skutt
On Jan 19, 1:37 am, "Octavian Rasnita" wrote: > > The users shouldn't want something better. Everyone should create GUIs which > are accessible for everyone by default, without making any special effort > for doing this. Accessibility always requires special effort, and I don't see how changing t

Re: Tkinter: The good, the bad, and the ugly!

2011-01-19 Thread Adam Skutt
On Jan 19, 1:37 am, "Octavian Rasnita" wrote: > > Most of the programmers don't know that and they don't even need to know > that, but if a lib that create accessible GUIS would be promoted, most of > the Python programmers would use that lib and would create good apps by > default, without even k

Re: UTF-8 question from Dive into Python 3

2011-01-19 Thread Adam Skutt
On Jan 19, 9:00 am, Tim Harig wrote: > > So, you can always assume a big-endian and things will work out correctly > while you cannot always make the same assumption as little endian > without potential issues.  The same holds true for any byte stream data. You need to spend some serious time pro

Re: Tkinter: The good, the bad, and the ugly!

2011-01-19 Thread Adam Skutt
On Jan 19, 10:41 am, "Octavian Rasnita" wrote: > > Not true. WxPython uses wxWIDGETS which uses the default OS widgets which > usually offer the accessibility features. > (At least under Windows, but most users that need accessibility use Windows > anyway). > Right, under Windows, which is a pr

Re: Tkinter: The good, the bad, and the ugly!

2011-01-19 Thread Adam Skutt
On Jan 19, 11:09 am, "Octavian Rasnita" wrote: > From: "Adam Skutt" > > Accessibility always requires special effort, and I don't see how > > changing toolkits gets away from this. > > This is the most false thing I ever heard and the most dan

Re: Tkinter: The good, the bad, and the ugly!

2011-01-19 Thread Adam Skutt
On Jan 19, 4:04 pm, "Octavian Rasnita" wrote: > Those rules for creating an accessible application are obvious; like the fact > that a button need to contain a text label and not only an image, or that an > image needs to have a tooltip defined, or that a radio button needs to have a > label at

Re: Tkinter: The good, the bad, and the ugly!

2011-01-20 Thread Adam Skutt
On Jan 20, 2:22 am, "Octavian Rasnita" wrote: > Where do you got the conclusion that the accessibility is so poor? By an examination of the facts. MSAA is universally hated and all screen readers actively have to work around it and its many limitations (meaning that as an application programmer,

Re: Tkinter: The good, the bad, and the ugly!

2011-01-20 Thread Adam Skutt
On Jan 20, 8:19 am, "Octavian Rasnita" wrote: > The Windows applications are not accessible only if they use MSAA. The > screen readers know how to get the necessary information for making the > interfaces accessible in other ways, but of course, it is harder for the > screen reader manufacturers

Re: Tkinter: The good, the bad, and the ugly!

2011-01-20 Thread Adam Skutt
On Jan 20, 10:44 am, "Octavian Rasnita" wrote: > From: "Adam Skutt" > Actually, JAWS uses MSAA dead last, as I understand it, because the > API is truly that awful.  But MSAA is necessary whenever you're not > using a Win32 common control or most of the other

Re: Tkinter: The good, the bad, and the ugly!

2011-01-20 Thread Adam Skutt
On Jan 20, 1:17 pm, Emile van Sebille wrote: > > The problem with QT is the license. Qt and wxWidgets are both LGPL and equally non-starters due to license, today. There was a hypothetical assumption on my part that the library would be made license compatible somehow, through the entire discussi

Re: Tkinter: The good, the bad, and the ugly!

2011-01-20 Thread Adam Skutt
On Jan 20, 3:02 pm, "Octavian Rasnita" wrote: > From: "Adam Skutt" > Yet, for some unfathomable reason, you > keep promoting > I would be glad if you could tell me about a portable solution which is > accessible with JAWS and Window Eyes, the most used screen

Re: examples of realistic multiprocessing usage?

2011-01-21 Thread Adam Skutt
On Jan 20, 11:51 pm, Albert van der Horst wrote: > This is what some people want you to believe. Arm twisting by > GPL-ers when you borrow their ideas? That is really unheard of. Doesn't matter, you're still legally liable if your work is found to be derivative and lacking a fair use defense. It

Re: WxPython versus Tkinter.

2011-01-23 Thread Adam Skutt
On Jan 22, 7:07 pm, rantingrick wrote: > So PUT UP OR SHUT THE HELL UP! You first. Write actual working code first and then you can challenge people. I found 5 bugs in your code before I quit looking[1]. Can you find and fix them all? Also, I'm entirely ignoring the bad styling, bad default si

Re: WxPython versus Tkinter.

2011-01-23 Thread Adam Skutt
On Jan 23, 12:21 pm, rantingrick wrote: > The code does work. You just lack the skill to run it. I not only possess the skill to run it, but to find fault it in through simple inspection. All of the bugs I found, but one, I found through reading the .py file. Heck, I'm so good that I guessed two

Re: WxPython versus Tkinter.

2011-01-23 Thread Adam Skutt
On Jan 23, 2:07 pm, rantingrick wrote: > Well then post a traceback. None of these issues will supply a traceback; in fact, in some of these cases, you went out of your way to ensure that would not happen. That's an additional bug (or 5 additional bugs depending how mean your tester/QA staff are

Re: WxPython versus Tkinter.

2011-01-23 Thread Adam Skutt
On Jan 23, 3:23 pm, rantingrick wrote: > psst: thats because they are FEATURES and NOT BUGS you idiot! Your application not displaying a directory listing, due to one of these "features", is desirable behavior? I think not. Your application hanging, due to one of these "features" is desirable b

Re: Shared memory python between two separate shell-launched processes

2011-02-11 Thread Adam Skutt
On Feb 10, 9:30 am, "Charles Fox (Sheffield)" wrote: > > But when I look at posix_ipc and POSH it looks like you have to fork > the second process from the first one, rather than access the shared > memory though a key ID as in standard C unix shared memory.  Am I > missing something?   Are there

Re: Shared memory python between two separate shell-launched processes

2011-02-12 Thread Adam Skutt
On Feb 12, 3:29 am, John Nagle wrote: > >     If you're having trouble debugging a sequential program, > you do not want to add shared memory to the problem. No, you don't want to add additional concurrent threads of execution. But he's not doing that, he's just preloading stuff into RAM. It's n

Re: multiprocessing & more

2011-02-13 Thread Adam Skutt
On Feb 13, 12:34 pm, Andrea Crotti wrote: > > First of all, does it make sense to use multiprocessing and a short > value as boolean to check if the simulation is over or not? > Maybe, but without knowing exactly what you're doing it's difficult to say if any other approach would be superior. Pl

  1   2   >