Re: OTish: using short-term TCP connections to send to multiple slaves

2014-11-17 Thread Peter Otten
jkn wrote: > Hi all > This is a little bit OT for this newsgroup, but I intend to use python > for prototyping at least, and I know there are a lot of knowledgeable > people using Python in a Network context here... > > I have a use case of a single 'master' machine which will need to > perio

Re: Interrupted system call

2014-11-17 Thread Peter Bell
Many thanks for your helpful response, Chris. On 17/11/14 06:13, Chris Angelico wrote: On Sun, Nov 16, 2014 at 7:11 PM, Peter Bell wrote: File "/usr/lib/python3.4/site-packages/serial/serialposix.py", line 480, in read if e[0] != errno.EAGAIN: TypeError: 'InterruptedError' object is no

Re: Interrupted system call

2014-11-17 Thread Chris Angelico
On Mon, Nov 17, 2014 at 3:10 PM, Peter Bell wrote: > Many thanks for your helpful response, Chris. > > On 17/11/14 06:13, Chris Angelico wrote: >> >> On Sun, Nov 16, 2014 at 7:11 PM, Peter Bell >> wrote: >>> >>>File "/usr/lib/python3.4/site-packages/serial/serialposix.py", line >>> 480, >>> i

Re: Interrupted system call

2014-11-17 Thread Peter Otten
Chris Angelico wrote: > On Mon, Nov 17, 2014 at 3:10 PM, Peter Bell > wrote: >> Many thanks for your helpful response, Chris. >> >> On 17/11/14 06:13, Chris Angelico wrote: >>> >>> On Sun, Nov 16, 2014 at 7:11 PM, Peter Bell >>> wrote: File "/usr/lib/python3.4/site-packages/serial/s

Re: Interrupted system call

2014-11-17 Thread Peter Bell
On 17/11/14 16:31, Chris Angelico wrote: On Mon, Nov 17, 2014 at 3:10 PM, Peter Bell wrote: Is there a better way to interface to a serial port from Python 3? I've found a reference in the PSF 3.3.6 FAQ which points to pyserial on sourceforge. ... a solution to this. I would suggest lookin

Re: Interrupted system call

2014-11-17 Thread Chris Angelico
On Mon, Nov 17, 2014 at 7:55 PM, Peter Otten <__pete...@web.de> wrote: > I'd suggest a more conservative path: if available install the version that > comes with your distribution. > > $ sudo apt-get python3-serial > > might do the job. Only if the Python to install to was also the distro-installe

Re: import graphics library; causes error

2014-11-17 Thread Steven D'Aprano
ryguy7272 wrote: > Python is by far the most backwards type > of technology that I can think of. Using it is completely > counter-productive. I can't take it serious. I have plenty of tools in > my toolbox. I'll keep learning Python, and keep reading books, and keep > using it...but strictly

Re: OTish: using short-term TCP connections to send to multiple slaves

2014-11-17 Thread alister
On Mon, 17 Nov 2014 08:56:43 +1100, Chris Angelico wrote: > On Mon, Nov 17, 2014 at 4:21 AM, Roy Smith wrote: >> In article , >> Chris Angelico wrote: >> >>> UDP for anything more than your network's MTU is inefficient >> >> Why do you say it's inefficient? Sure, the UDP datagram will get >> f

Re: import graphics library; causes error

2014-11-17 Thread Mark Lawrence
On 17/11/2014 03:03, ryguy7272 wrote: On Sunday, November 16, 2014 3:39:45 PM UTC-5, ryguy7272 wrote: These libraries drive me totally nuts. Sorry, just had to get it out there. Anyway, I open the cmd window, and typed this: 'easy_install python graphics'. So, it starts up and runs/downloads

Re: import graphics library; causes error

2014-11-17 Thread YBM
Le 17/11/2014 04:03, ryguy7272 a écrit : On Sunday, November 16, 2014 3:39:45 PM UTC-5, ryguy7272 wrote: These libraries drive me totally nuts. Sorry, just had to get it out there. Anyway, I open the cmd window, and typed this: 'easy_install python graphics'. So, it starts up and runs/downloa

I dont understand root['bg'] = 'red' where root is a tkinter.Tk object

2014-11-17 Thread ast
Hello, import tkinter root = tkinter.Tk() Let's see all attributes of root: root.__dict__ {'master': None, 'children': {}, '_tclCommands': ['tkerror', 'exit', '13825848destroy'], 'tk': , '_tkloaded': 1} Now we change the background color using following command: root['bg'] = 'red' I am w

Re: I dont understand root['bg'] = 'red' where root is a tkinter.Tk object

2014-11-17 Thread Peter Otten
ast wrote: > Hello, > > import tkinter > root = tkinter.Tk() > > Let's see all attributes of root: > root.__dict__ > {'master': None, 'children': {}, '_tclCommands': ['tkerror', 'exit', > {'13825848destroy'], 'tk': > , '_tkloaded': 1} > > Now we change the background color using following

Re: Karlsruhe (Germany) Python User Group, November 21st 2014, 7pm

2014-11-17 Thread M.-A. Lemburg
Added to the Python User Group calendar. Thanks. On 14.11.2014 06:43, Jürgen A. Erhard wrote: > The Karlsruhe Python User Group (KaPy) meets again. > > Friday, 2014-11-21 (November 21st) at 19:00 (7pm) in the rooms of Entropia eV > (the local affiliate of the CCC). See http://entropia.de/wiki/An

Re: I dont understand root['bg'] = 'red' where root is a tkinter.Tk object

2014-11-17 Thread ast
"Peter Otten" <__pete...@web.de> a écrit dans le message de news:mailman.15958.1416233676.18130.python-l...@python.org... ty -- https://mail.python.org/mailman/listinfo/python-list

Re: OTish: using short-term TCP connections to send to multiple slaves

2014-11-17 Thread Grant Edwards
On 2014-11-16, jkn wrote: > An analogy might be with a master and multiple slave devices sharing > a serial RS-485 bus. If that's the model you _want_, then UDP multicast matches it almost exactly. ;) > I have control over the format of the data to be send, so there can > and should be some in

Re: I dont understand root['bg'] = 'red' where root is a tkinter.Tk object

2014-11-17 Thread Terry Reedy
On 11/17/2014 8:32 AM, ast wrote: Hello, import tkinter root = tkinter.Tk() Let's see all attributes of root: root.__dict__ {'master': None, 'children': {}, '_tclCommands': ['tkerror', 'exit', '13825848destroy'], 'tk': , '_tkloaded': 1} Now we change the background color using following com

Re: caught in the import web again

2014-11-17 Thread Charles T. Smith
On Mon, 17 Nov 2014 08:08:40 +0100, dieter wrote: > "Charles T. Smith" writes: >> ... >> Are others equally frustrated by this or is there a trick or principle >> that I'm missing. At this point, I guess the way I'll have to proceed >> is to put every class in its own file, no matter how small.

Trouble getting full response content from PATCH request

2014-11-17 Thread John Gordon
I'm working with a third-party API and I'm seeing some behavior that I can't explain. The API uses the HTTP PATCH operation to set user passwords, and in case of unacceptable passwords, the response is supposed to be an HTML document containing a diagnostic message in the tag. When I submit my t

Re: Array of Functions

2014-11-17 Thread Anton
On Friday, November 14, 2014 2:17:38 PM UTC-8, Richard Riehle wrote: > In C, C++, Ada, and functional languages, I can create an array of functions, > albeit with the nastiness of pointers in the C family. For example, an > array of functions where each function is an active button, or an array

Re: caught in the import web again

2014-11-17 Thread Dave Angel
"Charles T. Smith" Wrote in message: > Well, I guess that's the definitive answer... the tips for delaying > import are good, I'll try to leverage them. > > I was hoping there would be a way to have python postpone evaluation > similar to C's forward references. > In a module that might get ta

Re: caught in the import web again

2014-11-17 Thread Steven D'Aprano
Charles T. Smith wrote: > Yes, we're talking about recursive imports here. It's a complex, object- > oriented system with big classes and little classes that are strongly > interrelated. Well, there's your problem right there. You're working with a complex, highly coupled code-base. Alarms bells

Re: caught in the import web again

2014-11-17 Thread Ian Kelly
On Mon, Nov 17, 2014 at 3:17 PM, Dave Angel wrote: > "Charles T. Smith" Wrote in message: > >> Well, I guess that's the definitive answer... the tips for delaying >> import are good, I'll try to leverage them. >> >> I was hoping there would be a way to have python postpone evaluation >> similar t

Re: Different behaviour in list comps and generator expressions

2014-11-17 Thread Steven D'Aprano
Steven D'Aprano wrote: > The following list comprehension and generator expression are almost, but > not quite, the same: > > [expr for x in iterable] > > list(expr for x in iterable) > > > The difference is in the handling of StopIteration raised inside the expr. [...] Thanks to Roy and Wol

Re: Different behaviour in list comps and generator expressions

2014-11-17 Thread Dan Stromberg
On Mon, Nov 17, 2014 at 3:30 PM, Steven D'Aprano wrote: >> The following list comprehension and generator expression are almost, but >> not quite, the same: >> >> [expr for x in iterable] >> >> list(expr for x in iterable) >> >> >> The difference is in the handling of StopIteration raised inside t

Re: caught in the import web again

2014-11-17 Thread Dave Angel
Ian Kelly Wrote in message: > On Mon, Nov 17, 2014 at 3:17 PM, Dave Angel wrote: >> In a module that might get tangled in a cycle, avoid global code >> that depends on other modules. Instead of putting such >> initialization at top level, put inside a function that gets >> called after all s

Re: caught in the import web again

2014-11-17 Thread Rick Johnson
On Monday, November 17, 2014 4:46:05 PM UTC-6, Steven D'Aprano wrote: > [...] > Python is not Java, nor Perl, and if you're putting every > class into its own file, you are doing it wrong. Stop making these gross generalizations. Just because Java *REQUIRES* that you only have one class per file d

Re: Different behaviour in list comps and generator expressions

2014-11-17 Thread Ethan Furman
On 11/17/2014 03:38 PM, Dan Stromberg wrote: > > I'm inclined to say that list comprehensions and generator expressions > should be different. I don't really think they should be identical, > one being eager and one being lazy. Why let the implementation detail > of one impact the other? It's n

Re: caught in the import web again

2014-11-17 Thread Chris Angelico
On Tue, Nov 18, 2014 at 1:17 PM, Rick Johnson wrote: > BOY I LOVE TROGGING! For consistency, you should say GOVE there. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

New Python Course

2014-11-17 Thread Steve Holden
Hi everybody, I am pleased to announce the availability of a Python Programming Skills Lab in London on December 9, 2014 in The Church House, Westminster. The blurb follows. Led by Steve Holden, a well-known educator and member of the Python community, this one-day lab presents Python programme

learn from the masters of python and other languages, free

2014-11-17 Thread ed
Hey all, Wanted to let you know about a special opportunity for subscribers to this list.. I'm hosting a virtual conference called hack.summit() happening December 1-4, where you can learn from some of the best programmers in the world. An unprecedented line-up of programmers are speaking, in

Re: caught in the import web again

2014-11-17 Thread Michael Torrie
On 11/17/2014 03:45 PM, Steven D'Aprano wrote: > Circular dependencies are not just a problem in Python, they are a problem > throughout most of software design. Personally I find that duck typing eliminates a lot of the circular dependency problems. Class A doesn't necessarily have to know abou

Re: caught in the import web again

2014-11-17 Thread Steven D'Aprano
On Mon, 17 Nov 2014 18:17:13 -0800, Rick Johnson wrote: > BOY I LOVE TROGGING! Yes, we've noticed. http://www.urbandictionary.com/define.php?term=trogging -- Steven -- https://mail.python.org/mailman/listinfo/python-list

Re: How to fix those errors?

2014-11-17 Thread Gregory Ewing
Roy Smith wrote: Wouldn't it make more sense to use four periods? def spam(arg) for x in seq pass Conversely, to save space you should be able to stack one of the dots of an ellipsis on top and write it as either .: or :. Taking this even further, we could allow all charac

Re: How to fix those errors?

2014-11-17 Thread Chris Angelico
On Tue, Nov 18, 2014 at 6:25 PM, Gregory Ewing wrote: > Taking this even further, we could allow all > characters to be encoded in 90-degree-rotated > Braille. This would be a tremendous advantage > for blind or poorly-sighted Python users. Indeed. However, which way should they be rotated? Clock