Re: [Tutor] multiprocessing question

2014-11-27 Thread Dave Angel
On 11/27/2014 04:01 PM, Albert-Jan Roskam wrote: I made a comparison between multiprocessing and threading. In the code below (it's also here: http://pastebin.com/BmbgHtVL, multiprocessing is more than 100 (yes: one hundred) times slower than threading! That is I-must-be-doing-something-

Re: [Tutor] Is there an easy way to center the root window (Tkinter) within the display?

2014-11-27 Thread Alan Gauld
On 27/11/14 19:26, Dave Angel wrote: scale of things is quite large. Does that package include any hooks for automating? > Are they open to requests for improving their software, or for validating your own front ends? For both your organization and theirs: Are you using source control?

Re: [Tutor] multiprocessing question

2014-11-27 Thread Albert-Jan Roskam
- Original Message - > From: Cameron Simpson > To: Python Mailing List > Cc: > Sent: Monday, November 24, 2014 11:16 PM > Subject: Re: [Tutor] multiprocessing question > > On 24Nov2014 12:56, Albert-Jan Roskam wrote: >> > From: Cameron Simpson >>> On 23Nov2014 22:30, Albert-Jan

Re: [Tutor] Is there an easy way to center the root window (Tkinter) within the display?

2014-11-27 Thread boB Stepp
On Nov 27, 2014 1:27 PM, "Dave Angel" wrote: > > On 11/27/2014 11:39 AM, boB Stepp wrote: >> >> On Thu, Nov 27, 2014 at 9:58 AM, Steven D'Aprano wrote: > > > > You say you're using some 3rd party package to do the heavy lifting. But you also say there could be as many as 1000 servers involved.

Re: [Tutor] multiprocessing question

2014-11-27 Thread Albert-Jan Roskam
> > From: eryksun >To: Python Mailing List >Sent: Tuesday, November 25, 2014 6:41 AM >Subject: Re: [Tutor] multiprocessing question > > >On Sun, Nov 23, 2014 at 7:20 PM, Cameron Simpson wrote: >> >> A remark about the create_lookup() function on pastebin: you g

Re: [Tutor] Is there an easy way to center the root window (Tkinter) within the display?

2014-11-27 Thread Dave Angel
On 11/27/2014 11:39 AM, boB Stepp wrote: On Thu, Nov 27, 2014 at 9:58 AM, Steven D'Aprano wrote: No offense intended Bob, but this scares me. I know you're trying your best, but "weak programming knowledge" and "radiation therapy" is not a healthy combination. Believe me, I think about this

Re: [Tutor] Question about why a list variable is apparently global.

2014-11-27 Thread Alan Gauld
On 27/11/14 16:07, boB Stepp wrote: Alan's reference to indentation level had me trying to prove the opposite--unsuccessfully. Yeah, I probably over-simplified there in response to your assumption that it was the order that mattered. It's really whether they are inside a function or class -

Re: [Tutor] Is there an easy way to center the root window (Tkinter) within the display?

2014-11-27 Thread boB Stepp
On Thu, Nov 27, 2014 at 9:58 AM, Steven D'Aprano wrote: > On Wed, Nov 26, 2014 at 12:25:23PM -0600, boB Stepp wrote: > >> As I am the only person in our >> group with any programming knowledge (weak though it is), this means I >> usually wind up trying to solve issues as they arise. These client >

Re: [Tutor] Question about why a list variable is apparently global.

2014-11-27 Thread Dave Angel
On 11/27/2014 11:07 AM, boB Stepp wrote: x = "outer" def tricky_func2(): y = x print(x) tricky_func2() outer So why does not print(x) see the global x and instead looks for the local x? The function is compiled during the import (or initial load if it's a

Re: [Tutor] Question about why a list variable is apparently global.

2014-11-27 Thread boB Stepp
On Thu, Nov 27, 2014 at 9:33 AM, Steven D'Aprano wrote: > On Thu, Nov 27, 2014 at 09:00:48AM -0600, boB Stepp wrote: [...] > But there is a subtlety that you may not expect: > > py> class Tricky: > ... print(x) > ... x = "inner" > ... print(x) > ... > outer > inner Actually, this is

Re: [Tutor] Is there an easy way to center the root window (Tkinter) within the display?

2014-11-27 Thread Steven D'Aprano
On Wed, Nov 26, 2014 at 12:25:23PM -0600, boB Stepp wrote: > As I am the only person in our > group with any programming knowledge (weak though it is), this means I > usually wind up trying to solve issues as they arise. These client > machines are dedicated to a single purpose: radiation therapy

Re: [Tutor] Question about why a list variable is apparently global.

2014-11-27 Thread Steven D'Aprano
On Thu, Nov 27, 2014 at 09:13:35AM -0600, boB Stepp wrote: > On Thu, Nov 27, 2014 at 4:56 AM, Steven D'Aprano wrote: > > On Wed, Nov 26, 2014 at 10:18:55PM -0600, boB Stepp wrote: > > > >> So any variables lower in the program are accessible to those above it? > > > > No, that can't be the explana

Re: [Tutor] Question about why a list variable is apparently global.

2014-11-27 Thread Steven D'Aprano
On Thu, Nov 27, 2014 at 09:00:48AM -0600, boB Stepp wrote: > Level of indentation is the key? Can you give me an example, not > involving functions, where a variable is defined at an "inner" level > of indentation, but is not accessible at the outermost level of > indentation? Classes and functi

Re: [Tutor] Question about why a list variable is apparently global.

2014-11-27 Thread boB Stepp
On Thu, Nov 27, 2014 at 4:56 AM, Steven D'Aprano wrote: > On Wed, Nov 26, 2014 at 10:18:55PM -0600, boB Stepp wrote: > >> So any variables lower in the program are accessible to those above it? > > No, that can't be the explanation. Think of this: > > b = a + 1 > a = 2 > > That will fail because w

Re: [Tutor] Question about why a list variable is apparently global.

2014-11-27 Thread boB Stepp
On Thu, Nov 27, 2014 at 4:51 AM, Alan Gauld wrote: > On 27/11/14 04:18, boB Stepp wrote: [...] >> So any variables lower in the program are accessible to those above it? > > > No. > Its not whether they are defined above or below each other its the level of > indentation. Both f and g are define

Re: [Tutor] Installing twisted

2014-11-27 Thread Alan Gauld
On 27/11/14 03:35, Scott W Dunning wrote: Hey guys I was hoping someone could tell me how to opted out of this list? > I have it going to two email addresses for some reason If you tell me what the two addresses are I can see which is master and you then need to log in with that address and uns

Re: [Tutor] Question about why a list variable is apparently global.

2014-11-27 Thread Steven D'Aprano
On Wed, Nov 26, 2014 at 10:18:55PM -0600, boB Stepp wrote: > So any variables lower in the program are accessible to those above it? No, that can't be the explanation. Think of this: b = a + 1 a = 2 That will fail because when the "b = a + 1" line is executed, a doesn't exist yet so there is n

Re: [Tutor] Installing twisted

2014-11-27 Thread Scott W Dunning
Hey guys I was hoping someone could tell me how to opted out of this list? I have it going to two email addresses for some reason and I unsubscribed but nothing happened. Any help is greatly appreciated! Thanks, Scott ___ Tutor maillist - Tut

Re: [Tutor] Question about why a list variable is apparently global.

2014-11-27 Thread Alan Gauld
On 27/11/14 04:18, boB Stepp wrote: Note that this principle is critical to Python, otherwise functions couldn't call each other, or even built-ins! If you have two functions: def f(): return g() def g(): return "Hello!" "g" is a global "variable" and f() can see it, otherwise it couldn't cal