Re: best way to remove leading zeros from a tuple like string

2018-05-21 Thread Wolfram Hinderer via Python-list
Am 21.05.2018 um 01:16 schrieb bruceg113...@gmail.com: If I decide I need the parentheses, this works. "(" + ",".join([str(int(i)) for i in s[1:-1].split(",")]) + ")" '(128,20,8,255,-1203,1,0,-123)' Thanks, Bruce Creating the tuple seems to be even simpler. >>> str(tuple(map(int, s[1:-1].s

Issue

2018-05-21 Thread sujith.j Sjk
> Hi, > > Am facing the below issue when starting pyton. > > > -- https://mail.python.org/mailman/listinfo/python-list

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Christian Gollwitzer
Am 22.05.18 um 04:17 schrieb Mikhail V: On Mon, May 21, 2018 at 1:41 PM, Chris Lindsay via Python-list wrote: If a block of static data is large enough to start to be ugly, a common approach is to load the data from some other file, in a language which is designed around structured data. Ma

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Joe Pfeiffer
Mikhail V writes: > On Mon, May 21, 2018 at 1:41 PM, Chris Lindsay via Python-list > wrote: > >> If a block of static data is large enough to start to be ugly, a common >> approach is to load the data from some other file, in a language which is >> designed around structured data. > > > Maybe it

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Mikhail V
On Mon, May 21, 2018 at 3:48 PM, bartc wrote: > > This is intended to be used inside actual Python programs? > > In that case code is normally displayed in fixed pitch, as it would normally > be viewed in a code editor, even if part of a document. > > But I have to say it looks pretty terrible, a

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Ben Finney
Ned Batchelder writes: > You've proposed it and asked for feedback, but you seem to be > completely ignoring the feedback people are giving you. Another problem with the proposal: The motivation to introduce such a large change is not compelling. What is the problem this proposal aims to solve?

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Ned Batchelder
On 5/21/18 9:42 PM, Mikhail V wrote: On Mon, May 21, 2018 at 2:14 PM, Ned Batchelder wrote: On 5/19/18 10:58 PM, Mikhail V wrote: I have made up a printable PDF with the current version of the syntax suggestion. https://github.com/Mikhail22/Documents/blob/master/data-blocks-v01.pdf After som

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Mikhail V
On Mon, May 21, 2018 at 1:41 PM, Chris Lindsay via Python-list wrote: > If a block of static data is large enough to start to be ugly, a common > approach is to load the data from some other file, in a language which is > designed around structured data. Maybe it is common in industrial applica

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Mikhail V
On Mon, May 21, 2018 at 2:14 PM, Ned Batchelder wrote: > On 5/19/18 10:58 PM, Mikhail V wrote: >> >> I have made up a printable PDF with the current version >> of the syntax suggestion. >> >> https://github.com/Mikhail22/Documents/blob/master/data-blocks-v01.pdf >> >> After some of your comments I

Re: Python 3.6 causes error, python 3.5 does not.

2018-05-21 Thread Jim
On 05/20/2018 02:03 PM, Jim wrote: Mint 18 Libreoffice 5.1.6.2 Python 3.6.5 in one virtual environment Python 3.5.2 in another I am writing a script that uses pyautogui to get some data and paste it into a Libreoffice calc file, there by bypassing the complexity of uno. The problem is it runs

RE: "Data blocks" syntax specification draft

2018-05-21 Thread Dan Strohl via Python-list
On 5/19/18 10:58 PM, Mikhail V wrote: >> I have made up a printable PDF with the current version of the syntax >> suggestion. >> >> https://github.com/Mikhail22/Documents/blob/master/data-blocks-v01.pdf >> >> After some of your comments I've made some further re-considerations, >> e.g. element se

Re: best way to remove leading zeros from a tuple like string

2018-05-21 Thread brucegoodstein
On Monday, May 21, 2018 at 1:05:52 PM UTC-4, Rodrigo Bistolfi wrote: > >>> repr(tuple(int(i) for i in s[1:-1].split(','))) > '(128, 20, 8, 255, -1203, 1, 0, -123)' > > 2018-05-21 4:26 GMT-03:00 Peter Otten <__pete...@web.de>: > > > bruceg113...@gmail.com wrote: > > > > > Looking over the response

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Marko Rauhamaa
Mikhail V : > How do you do that?! You're truly unsurpassed master of polemics. How > you turn everything upside down so easily? If someone's behavior annoys you too much, just put them in your kill file. (And no, you don't have to declare it publically.) Marko -- https://mail.python.org/mailm

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Chris Angelico
On Tue, May 22, 2018 at 4:08 AM, Mikhail V wrote: >>> Ok. How is about images? this proposal will require a lot of images >>> - otherwise people who read it are forced to copy-paste snippets >>> into their code editors to understand how it may look in reality. >> >> If you're proposing syntax for

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Mikhail V
On Mon, May 21, 2018 at 7:05 AM, Chris Angelico wrote: >>> Forcing us to download a PDF and then read it? Well, it's your >>> decision. My decision is that I cannot be bothered going to THAT much >>> effort to figure out what you're saying. >> >> THAT much effort to click two times instead of one

Re: Numpy array

2018-05-21 Thread Rob Gaddi
On 05/18/2018 09:50 PM, Sharan Basappa wrote: This is regarding numpy array. I am a bit confused how parts of the array are being accessed in the example below. 1 import scipy as sp 2 data = sp.genfromtxt("web_traffic.tsv", delimiter="\t") 3 print(data[:10]) 4 x = data[:,0] 5 y = data[:,1] App

Re: best way to remove leading zeros from a tuple like string

2018-05-21 Thread Rodrigo Bistolfi
>>> repr(tuple(int(i) for i in s[1:-1].split(','))) '(128, 20, 8, 255, -1203, 1, 0, -123)' 2018-05-21 4:26 GMT-03:00 Peter Otten <__pete...@web.de>: > bruceg113...@gmail.com wrote: > > > Looking over the responses, I modified my original code as follows: > > > s = "(128, 020, 008, 255, -

Re: Spam levels.

2018-05-21 Thread Grant Edwards
On 2018-05-21, José María Mateos wrote: > On Mon, May 21, 2018 at 10:00:41AM +0200, m wrote: >> I also almost stopped reading c.l.python, because of enormous spam >> levels. Do I have any option to read it without spam, other than launch >> my own filtering NNTP server and do whack the mole game f

Re: Spam levels.

2018-05-21 Thread José María Mateos
On Mon, May 21, 2018 at 10:00:41AM +0200, m wrote: > I also almost stopped reading c.l.python, because of enormous spam > levels. Do I have any option to read it without spam, other than launch > my own filtering NNTP server and do whack the mole game for myself? > > Maybe join forces and establis

Re: "Data blocks" syntax specification draft

2018-05-21 Thread bartc
On 20/05/2018 03:58, Mikhail V wrote: I have made up a printable PDF with the current version of the syntax suggestion. https://github.com/Mikhail22/Documents/blob/master/data-blocks-v01.pdf After some of your comments I've made some further re-considerations, e.g. element separation should be

Re: "Data blocks" syntax specification draft

2018-05-21 Thread bartc
On 21/05/2018 05:05, Chris Angelico wrote: On Mon, May 21, 2018 at 2:00 PM, Mikhail V wrote: heaps! oh come on, youre making up again. No, I'm not making it up. Just because the PDF works perfectly for you, you assume that it'll work perfectly for everyone. That is not the case, and that is

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Ned Batchelder
On 5/19/18 10:58 PM, Mikhail V wrote: I have made up a printable PDF with the current version of the syntax suggestion. https://github.com/Mikhail22/Documents/blob/master/data-blocks-v01.pdf After some of your comments I've made some further re-considerations, e.g. element separation should be

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Chris Lindsay via Python-list
So this is a syntax for defining large blocks of static data in-line with code. If a block of static data is large enough to start to be ugly, a common approach is to load the data from some other file, in a language which is designed around structured data. YAML comes to mind - it has minimal pun

Re: Poor corporate communication culture - was Re: syntax oddities

2018-05-21 Thread Steven D'Aprano
On Sun, 20 May 2018 20:39:44 -0600, Michael Torrie wrote: > Nine times out of ten, a top posted reply from a manager is a sure sign > he hasn't bothered to read anything of what I actually wrote. Instead he > just answers the question he thought I asked. And the other one time out of ten, he's on

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Steven D'Aprano
On Mon, 21 May 2018 01:28:51 +0300, Mikhail V wrote: > Source examples on > Github will force a crappy font and replace tabs. Is that supposed to convince us that using mandatory TABs is a good idea? -- Steve -- https://mail.python.org/mailman/listinfo/python-list

Re: "Data blocks" syntax specification draft

2018-05-21 Thread m
W dniu 21.05.2018 o 06:00, Mikhail V pisze: >> As Ian says, reStructuredText is the only supported format [1] for >> PEPs, so you may as well just start using it straight away. GitHub >> automatically renders it if you use a ".rst" extension on your file, >> so the rendered form would be visible on

Re: Spam levels.

2018-05-21 Thread m
W dniu 10.02.2018 o 15:57, C W Rose pisze: > No other groups (in the limited set which I read) have the problem, > and I don't understand why the spammers neither spam a range of > groups, nor change their adddresses more frequently. It may be > that destroying comp.lang.python is their actual obj

Re: best way to remove leading zeros from a tuple like string

2018-05-21 Thread Peter Otten
bruceg113...@gmail.com wrote: > Looking over the responses, I modified my original code as follows: > s = "(128, 020, 008, 255, -1203,01,-000, -0123)" ",".join([str(int(i)) for i in s[1:-1].split(",")]) > '128,20,8,255,-1203,1,0,-123' I think this looks better with a generator inst

Re: Python 3.6 causes error, python 3.5 does not.

2018-05-21 Thread dieter
Jim writes: > ... > The problem is it runs fine if I use python 3.5. If I use python 3.6 > it opens the calc file then pops up a dialog saying > "std::bad_alloc". This looks like a C++ error message -- maybe from "calc". It also looks quite severe (some memory allocation problem). Therefore, it

Re: decorat{or,ion}

2018-05-21 Thread dieter
Mike McClain writes: > ... > Thanks for the response, this is still a foreign language to me and I > need all > the help I can get. I'm reading the docs, doing the tutorial again but > still have > more questions than answers. > If I understand what you said, 'taint neces