Re: right list for SIGABRT python binary question ?

2017-11-02 Thread dieter
Karsten Hilbert writes: > ... > I have posted backtraces taken from the address being > watched. Does that help any at all ? Only in the case that the error is "local", i.e. detected (quite) immediately. You might be in this case as you have observed that the address is stable after library prel

Re: A use-case for for...else with no break

2017-11-02 Thread Paul Rubin
Steve D'Aprano writes: > for x in something(): > print(x, end='') print(''.join(something())) -- https://mail.python.org/mailman/listinfo/python-list

Re: Thread safety issue (I think) with defaultdict

2017-11-02 Thread Steve D'Aprano
On Fri, 3 Nov 2017 02:32 pm, Stefan Ram wrote: > Here is an excerpt from a text from Edward E. Lee: > > A part of the Ptolemy Project experiment was to see > whether effective software engineering practices could be > developed for an academic research setting. [...] > No problems were observed

Re: Thread safety issue (I think) with defaultdict

2017-11-02 Thread Steve D'Aprano
On Fri, 3 Nov 2017 02:19 pm, Rustom Mody wrote: > «The world is concurrent» [Joe Armstrong creator of Erlang] And the world is extremely complex, complicated and hard to understand. The point of programming is to simplify the world, not emulate it in its full complexity. -- Steve “Cheer up,

Re: Thread safety issue (I think) with defaultdict

2017-11-02 Thread Rustom Mody
On Friday, November 3, 2017 at 6:28:28 AM UTC+5:30, Steve D'Aprano wrote: > On Fri, 3 Nov 2017 07:24 am, Chris Angelico wrote: > > > On Fri, Nov 3, 2017 at 3:27 AM, Israel Brewster wrote: > >> > >> Actually, that saying is about regular expressions, not threads :-) . In > >> the end, threads are a

Re: A use-case for for...else with no break

2017-11-02 Thread Terry Reedy
On 11/2/2017 8:53 PM, Steve D'Aprano wrote: On Fri, 3 Nov 2017 09:20 am, Terry Reedy wrote: This seems like a bug in how Python interacts with your console. On Windows, in Python started from an icon or in Command Prompt: >>> for c in 'abc': print(c, end='') ... abc>>> That's still unfortu

Re: Invoking return through a function?

2017-11-02 Thread Rustom Mody
On Tuesday, October 31, 2017 at 11:05:30 AM UTC+5:30, Steve D'Aprano wrote: > On Tue, 31 Oct 2017 02:26 pm, Rustom Mody wrote: > > > My own feeling about lisp-macros is conflicted: > > - They are likely the most unique feature of lisp, putting it at the top of > > the blub-language tower > > - The

Re: Key Press Not Working

2017-11-02 Thread MRAB
On 2017-11-03 02:40, brandon wallace wrote: I am trying to catch a key press but it is not working. How can I fix this code? There is no error message so there is no error message to do a search on. I am using Python3.5 64-bit inside the terminal. while True: key = input("Enter a lette

Key Press Not Working

2017-11-02 Thread brandon wallace
  I am trying to catch a key press but it is not working. How can I fix this code? There is no error message so there is no error message to do a search on. I am using Python3.5 64-bit inside the terminal. while True: key = input("Enter a letter: ") if key == ord('q'): break    

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Steve D'Aprano
On Fri, 3 Nov 2017 03:31 am, Jon Ribbens wrote: > On 2017-11-02, Steve D'Aprano wrote: >> On Fri, 3 Nov 2017 12:39 am, Jon Ribbens wrote: >>> Why would we want to make the language worse? It is fairly obvious >>> what 'else' means, >> >> Yes, obvious and WRONG. > > Nope, obvious and right. > >>

Re: Thread safety issue (I think) with defaultdict

2017-11-02 Thread Steve D'Aprano
On Fri, 3 Nov 2017 07:24 am, Chris Angelico wrote: > On Fri, Nov 3, 2017 at 3:27 AM, Israel Brewster > wrote: >> >> Actually, that saying is about regular expressions, not threads :-) . In >> the end, threads are as good a way as handling concurrency as any other, >> and simpler than many. They h

Re: A use-case for for...else with no break

2017-11-02 Thread Steve D'Aprano
On Fri, 3 Nov 2017 09:20 am, Terry Reedy wrote: > This seems like a bug in how Python interacts with your console. On > Windows, in Python started from an icon or in Command Prompt: > > >>> for c in 'abc': print(c, end='') > ... > abc>>> That's still unfortunate: the prompt is immediately afte

Re: what exactly does type.__call__ do?

2017-11-02 Thread Jason Maldonis
Thanks for your response. I'm confident that my use case for this metaclass is correct for what I'm trying to do. I've been using them for a few years now, but sparingly because as you said they are almost always unnecessary. I simplified my example significantly for discussion -- I'm not actually

Re: Share unpickleable object across processes

2017-11-02 Thread Chris Angelico
On Fri, Nov 3, 2017 at 11:00 AM, Dennis Lee Bieber wrote: > On Thu, 2 Nov 2017 12:32:35 -0800, Israel Brewster > declaimed the following: > > >> >>I *must* be thinking about this wrong. Take even a basic chat app that uses >>websockets. Client a, which connected to process 1, sends a message to

mimedecode 2.8.0

2017-11-02 Thread Oleg Broytman
Hello! mimedecode.py WHAT IS IT Mail users, especially in non-English countries, often find that mail messages arrived in different formats, with different content types, in different encodings and charsets. Usually this is good because it allows us to use appr

Re: FW: Reading a remove csv file

2017-11-02 Thread Terry Reedy
On 11/2/2017 9:18 AM, ROGER GRAYDON CHRISTMAN wrote: I have a partial answer to my own question: This seems to work for me: --- link = urllib.request.urlopen(urlpath) data = link.read().decode('utf-8').split('\n') reader = csv.DictReader(data) for row in reader: --- I think here my concern is

Re: bug in ''.format()

2017-11-02 Thread Ken Kundert
Sure enough. There is it, right there in the documentation. I did not read far enough. My bad. Thanks! -Ken -- https://mail.python.org/mailman/listinfo/python-list

Re: A use-case for for...else with no break

2017-11-02 Thread Terry Reedy
On 11/2/2017 6:10 AM, Steve D'Aprano wrote: Occasionally it is useful to loop over a bunch of stuff in the interactive interpreter, printing them as you go on a single line: for x in something(): print(x, end='') If you do that, the prompt overwrites your output, and you get a mess: py>

Re: bug in ''.format()

2017-11-02 Thread MRAB
On 2017-11-02 21:30, Ken Kundert wrote: I just encountered this: '{:0s}'.format('hello') Traceback (most recent call last): File "", line 1, in ValueError: '=' alignment not allowed in string format specifier The exception goes away if I do not specify a width of the string: '{:s}'.form

Re: Share unpickleable object across processes

2017-11-02 Thread Chris Angelico
On Fri, Nov 3, 2017 at 8:10 AM, Israel Brewster wrote: > Gotcha, thanks. The hesitation I have there is that the UWSGI config is a > user setting. Sure, I can set up my install to only run one process, but > what if someone else tries to use my code, and they set up UWSGI to run > multiple? I hate

bug in ''.format()

2017-11-02 Thread Ken Kundert
I just encountered this: >>> '{:0s}'.format('hello') Traceback (most recent call last): File "", line 1, in ValueError: '=' alignment not allowed in string format specifier The exception goes away if I do not specify a width of the string: >>> '{:s}'.format('hello') 'hello' My reading of the

Re: Share unpickleable object across processes

2017-11-02 Thread Israel Brewster
On Nov 2, 2017, at 12:36 PM, Chris Angelico wrote: > > On Fri, Nov 3, 2017 at 7:35 AM, Israel Brewster > wrote: >> On Nov 2, 2017, at 12:30 PM, Chris Angelico wrote: >>> >>> On Fri, Nov 3, 2017 at 5:54 AM, Israel Brewster >>> wrote: I have a Flask/UWSGI web

Re: Share unpickleable object across processes

2017-11-02 Thread Chris Angelico
On Fri, Nov 3, 2017 at 7:35 AM, Israel Brewster wrote: > On Nov 2, 2017, at 12:30 PM, Chris Angelico wrote: >> >> On Fri, Nov 3, 2017 at 5:54 AM, Israel Brewster >> wrote: >>> I have a Flask/UWSGI web app that serves up web socket connections. When a >>> web socket connection is created, I wan

Re: Share unpickleable object across processes

2017-11-02 Thread Israel Brewster
On Nov 2, 2017, at 11:15 AM, Stefan Ram wrote: > > Israel Brewster writes: >> the data structure that stores the socket connections needs >> to be shared across all said processes. > > IIRC that's the difference between threads and > processes: threads share a common memory. > > You can use

Re: Share unpickleable object across processes

2017-11-02 Thread Israel Brewster
On Nov 2, 2017, at 12:30 PM, Chris Angelico wrote: > > On Fri, Nov 3, 2017 at 5:54 AM, Israel Brewster wrote: >> I have a Flask/UWSGI web app that serves up web socket connections. When a >> web socket connection is created, I want to store a reference to said web >> socket so I can do things

Re: Share unpickleable object across processes

2017-11-02 Thread Chris Angelico
On Fri, Nov 3, 2017 at 5:54 AM, Israel Brewster wrote: > I have a Flask/UWSGI web app that serves up web socket connections. When a > web socket connection is created, I want to store a reference to said web > socket so I can do things like write messages to every connected > socket/disconnect

Re: Thread safety issue (I think) with defaultdict

2017-11-02 Thread Chris Angelico
On Fri, Nov 3, 2017 at 3:27 AM, Israel Brewster wrote: > > Actually, that saying is about regular expressions, not threads :-) . In the > end, threads are as good a way as handling concurrency as any other, and > simpler than many. They have their drawbacks, of course, mainly in the area > of o

Share unpickleable object across processes

2017-11-02 Thread Israel Brewster
I have a Flask/UWSGI web app that serves up web socket connections. When a web socket connection is created, I want to store a reference to said web socket so I can do things like write messages to every connected socket/disconnect various sockets/etc. UWSGI, however, launches multiple child pro

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Wolfgang Maier
On 11/02/2017 06:09 PM, Skip Montanaro wrote: Eh, what can I say? I guess I was paying too much attention to the baseball game. Yes, "else" handles the "fall off the end" termination, not the "exit early" termination. My apologies. I do think that having a way to spell "do this when the loop exit

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Skip Montanaro
Eh, what can I say? I guess I was paying too much attention to the baseball game. Yes, "else" handles the "fall off the end" termination, not the "exit early" termination. My apologies. I do think that having a way to spell "do this when the loop exits early" makes things clearer. So, perhaps while

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Jon Ribbens
On 2017-11-02, Steve D'Aprano wrote: > On Fri, 3 Nov 2017 12:39 am, Jon Ribbens wrote: >> Why would we want to make the language worse? It is fairly obvious >> what 'else' means, > > Yes, obvious and WRONG. Nope, obvious and right. > for x in seq: > do_something() > else: > print("seq w

Re: Thread safety issue (I think) with defaultdict

2017-11-02 Thread Israel Brewster
> On Nov 1, 2017, at 4:53 PM, Steve D'Aprano wrote: > > On Thu, 2 Nov 2017 05:53 am, Israel Brewster wrote: > > [...] >> So the end result is that the thread that "updates" the dictionary, and the >> thread that initially *populates* the dictionary are actually running in >> different processes

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Steve D'Aprano
On Fri, 3 Nov 2017 12:39 am, Jon Ribbens wrote: > On 2017-11-01, Alexey Muranov wrote: >> what do you think about the idea of replacing "`else`" with "`then`" in >> the contexts of `for` and `try`? >> >> It seems clear that it should be rather "then" than "else." Compare >> also "try ... then ..

Re: Python Packages Error - Unresolved

2017-11-02 Thread Rhodri James
On 02/11/17 11:17, Hinds, Megan wrote: Hi there, I was hoping you could help, as I have tried many different websites on this query and even asked the question on stackflow. I have tried many different types of commands in command prompt with the same error. I have recently installed Python 3

Python Packages Error - Unresolved

2017-11-02 Thread Hinds, Megan
Hi there, I was hoping you could help, as I have tried many different websites on this query and even asked the question on stackflow. I have tried many different types of commands in command prompt with the same error. I have recently installed Python 3.6. The 32 bit installation (automaticall

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread breamoreboy
On Wednesday, November 1, 2017 at 9:14:05 PM UTC, Alexey Muranov wrote: > Hello, > > what do you think about the idea of replacing "`else`" with "`then`" in > the contexts of `for` and `try`? > > It seems clear that it should be rather "then" than "else." Compare > also "try ... then ... final

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Jon Ribbens
On 2017-11-01, Alexey Muranov wrote: > what do you think about the idea of replacing "`else`" with "`then`" in > the contexts of `for` and `try`? > > It seems clear that it should be rather "then" than "else." Compare > also "try ... then ... finally" with "try ... else ... finally". > > Curren

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Jerry Hill
On Wed, Nov 1, 2017 at 5:12 PM, Alexey Muranov wrote: > what do you think about the idea of replacing "`else`" with "`then`" in > the contexts of `for` and `try`? > ​I wish the core python developers​ had done it 20 years ago. Given that python is a relatively mature language at this point, I d

FW: Reading a remove csv file

2017-11-02 Thread ROGER GRAYDON CHRISTMAN
I have a partial answer to my own question: This seems to work for me: --- link = urllib.request.urlopen(urlpath) data = link.read().decode('utf-8').split('\n') reader = csv.DictReader(data) for row in reader: --- I think here my concern is that now 'data' is now a variable in my program's memor

Re: Reading a remove csv file

2017-11-02 Thread Peter Otten
ROGER GRAYDON CHRISTMAN wrote: > Just a quick question on how best to read a remote CSV file. > So far, I tried: > > filelink = urllib.request.urlopen(path) > dictread = csv.DictReader(filelink) > for row in dictread:... > But I'm running into the difference between strings and bytes. > I'd

Worldwide Latest new Feature Automotive Power Electronics 2017 by Technology and news

2017-11-02 Thread karishmamtip
Automotive Power Electronics are the devices installed and used for controlling the high voltage and converting varied electric power in a most proficient way. These devices also helps in monitoring a power consumption in an optimized manner. One of the major driver for the growth of Automotive

Re: A use-case for for...else with no break

2017-11-02 Thread Steve D'Aprano
On Thu, 2 Nov 2017 10:45 pm, Alberto Berti wrote: >> "Steve" == Steve D'Aprano writes: > > py> for x in "abcdefgh": > Steve> ... print(x, end='') > Steve> ... > py> efghpy> > > > Steve> "For ... else" to the rescue! > > py> for char in "abcdefgh": > Steve>

Worldwide Latest new Feature Automotive Power Electronics 2017 by Technology and news

2017-11-02 Thread karishmamtip
Automotive Power Electronics are the devices installed and used for controlling the high voltage and converting varied electric power in a most proficient way. These devices also helps in monitoring a power consumption in an optimized manner. One of the major driver for the growth of Automotive

Re: matplot plot hangs

2017-11-02 Thread Tim Williams
On Wednesday, November 1, 2017 at 6:30:27 PM UTC-4, Andrew Z wrote: > nope. it doesnt: > > I added print-s after each line and that produced: > [az@hp src]$ cat ./main1.py > import matplotlib.pyplot as plt > print("imported") > plt.plot([1,2,4,1]) > print("plot is done") > plt.show() > print("show

Re: A use-case for for...else with no break

2017-11-02 Thread Alberto Berti
> "Wolfgang" == Wolfgang Maier > writes: Wolfgang> Try running it interactively and you'll see, Wolfgang> wolfgang I've tried but my muscolar memory failed me... i've issued a C-c C-c that usually would have sent the region of text to the interpreter session (when done from python

Re: Code Snippets

2017-11-02 Thread Rhodri James
On 01/11/17 18:57, Stefan Ram wrote: Ned Batchelder writes: You should not optimize for the shortest time to paste a line of code. You should take time and care writing your code, so that it reads best and runs best.  If you needed another os function, would you have two __import__("os") in y

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Ben Bacarisse
Steve D'Aprano writes: > On Thu, 2 Nov 2017 10:09 pm, Ben Bacarisse wrote: > >> Sure, but your argument seemed to that else has entirely the wrong >> meaning (I certainly to a double take when I have to remember what it >> means) and, in that context, finally has a meaning closer to what you >> w

Re: A use-case for for...else with no break

2017-11-02 Thread Wolfgang Maier
On 11/02/2017 12:45 PM, Alberto Berti wrote: "Steve" == Steve D'Aprano writes: py> for x in "abcdefgh": Steve> ... print(x, end='') Steve> ... py> efghpy> Steve> "For ... else" to the rescue! py> for char in "abcdefgh": Steve> ... print(char, end='

Reading a remove csv file

2017-11-02 Thread ROGER GRAYDON CHRISTMAN
Just a quick question on how best to read a remote CSV file. So far, I tried: filelink = urllib.request.urlopen(path) dictread = csv.DictReader(filelink) for row in dictread:... But I'm running into the difference between strings and bytes. I'd like to squeeze a note that talks about the utf-

Re: A use-case for for...else with no break

2017-11-02 Thread Alberto Berti
> "Steve" == Steve D'Aprano writes: py> for x in "abcdefgh": Steve> ... print(x, end='') Steve> ... py> efghpy> Steve> "For ... else" to the rescue! py> for char in "abcdefgh": Steve> ... print(char, end='') Steve> ... else: Steve> ... print(

Rise of Iot Application Has Opened a Potential Avenue of Application for Mobility Sharing Market 2025

2017-11-02 Thread sayalitip
FREE| Sample Copy is available at https://tinyurl.com/ybhr3gaj Mobility sharing is a term that is used to describe the transportation services that are shared among users. This includes public transit, taxis and limos, bike sharing, car sharing, ride sharing, scooter sharing, shuttle services a

Re: right list for SIGABRT python binary question ?

2017-11-02 Thread Karsten Hilbert
On Wed, Nov 01, 2017 at 04:28:02PM +, Grant Edwards wrote: > >>I understand. Thank you for the explanation. This may seem > >>like a dumb question: the actual address that gets corrupted > >>varies from run to run (it may be the same "place" in the > > > > Since the process virtual memory

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Steve D'Aprano
On Thu, 2 Nov 2017 10:09 pm, Ben Bacarisse wrote: > Sure, but your argument seemed to that else has entirely the wrong > meaning (I certainly to a double take when I have to remember what it > means) and, in that context, finally has a meaning closer to what you > want. That's an argument about w

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Ben Bacarisse
Steve D'Aprano writes: > On Thu, 2 Nov 2017 12:50 pm, Ben Bacarisse wrote: > >> Steve D'Aprano writes: >> >>> On Thu, 2 Nov 2017 08:12 am, Alexey Muranov wrote: >>> what do you think about the idea of replacing "`else`" with "`then`" in the contexts of `for` and `try`? > [...] >> Re-u

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Steve D'Aprano
On Thu, 2 Nov 2017 09:04 pm, Steve D'Aprano wrote: > then (with special case) of `pass` That should read "then except for the special case of `pass`". Sorry. -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https://mail.python.o

Re: install on host not connected to the internet and no local proxy

2017-11-02 Thread Paul Moore
On 2 November 2017 at 07:17, Chris Angelico wrote: > On Thu, Nov 2, 2017 at 5:50 PM, Noah wrote: >> Hi, >> >> I am trying to install a python package with about 80 dependencies on a >> server that is not connected to the internet and has no local proxy. I can >> ssh to it via VPN. >> >> I was ab

A use-case for for...else with no break

2017-11-02 Thread Steve D'Aprano
Occasionally it is useful to loop over a bunch of stuff in the interactive interpreter, printing them as you go on a single line: for x in something(): print(x, end='') If you do that, the prompt overwrites your output, and you get a mess: py> for x in "abcdefgh": ... print(x, end='') .

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Steve D'Aprano
On Thu, 2 Nov 2017 12:49 pm, Skip Montanaro wrote: > I don't know. The word "then" doesn't connote different ways of exiting a > loop to me ("else" doesn't really either, I will grant you that, but it's > what we have). Here's how I would read things: > >- *while* some condition holds, execut

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Chris Angelico
On Thu, Nov 2, 2017 at 7:05 PM, Alexey Muranov wrote: > On Wed, 2017-11-01 at 21:30 +, Stefan Ram wrote: >> >> > >> > In languages like Algol 68, »then« is used for a clause >> > that is to be executed when the main condition of an >> > if-statement /is/ true, so this might cause some co

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Alexey Muranov
On Thu, 2017-11-02 at 08:21 +1100, Chris Angelico wrote: > > With try/except/else, it's "do this, and if an exception happens, do this, else do this". So else makes perfect sense. Indeed, i forgot about `except`. I agree that "try/then/except/finally" would be better than "try/except/then/f

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Terry Reedy
On 11/1/2017 5:12 PM, Alexey Muranov wrote: what do you think about the idea of replacing "`else`" with "`then`" in the contexts of `for` and `try`? This idea has been argued to death more than once before. I am opposed on both logical and practical grounds, but will not repeat myself for t

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Alexey Muranov
On Wed, 2017-11-01 at 21:30 +, Stefan Ram wrote: > > In languages like Algol 68, »then« is used for a clause > that is to be executed when the main condition of an > if-statement /is/ true, so this might cause some confusion. > sure, and `else` is used for a clause that is to be execu

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Alexey Muranov
On Thu, 2017-11-02 at 08:29 +1100, Chris Angelico wrote: > On Thu, Nov 2, 2017 at 8:23 AM, Ned Batchelder > > wrote: > > > > > > Apart from the questions of backward compatibility etc (Python is > > unlikely > > to ever go through another shift like the 2/3 breakage), are you > > sure "then" >

Re: install on host not connected to the internet and no local proxy

2017-11-02 Thread Chris Angelico
On Thu, Nov 2, 2017 at 5:50 PM, Noah wrote: > Hi, > > I am trying to install a python package with about 80 dependencies on a > server that is not connected to the internet and has no local proxy. I can > ssh to it via VPN. > > I was able to find python bundle and download the tarballs for all th

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Chris Angelico
On Thu, Nov 2, 2017 at 12:42 PM, bartc wrote: > But if people prefer a different keyword, then why not? I think 'then' can > be used, without impacting its use as an identifier, because it will always > be followed by ":". Of course you would need to allow both "else" and "then" > for backwards co

install on host not connected to the internet and no local proxy

2017-11-02 Thread Noah
Hi, I am trying to install a python package with about 80 dependencies on a server that is not connected to the internet and has no local proxy. I can ssh to it via VPN. I was able to find python bundle and download the tarballs for all the main python package and all the tarballs for the s

Re: right list for SIGABRT python binary question ?

2017-11-02 Thread dieter
Karsten Hilbert writes: >> >> It points to a memory corruption. >> >> The i386/x64 architecture supports memory access breakpoints >> and GDB, too, has support for this. You know the address which >> gets corrupted. Thus, the following apporach could have a chance >> to succeed: >> >>Put a "