Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Steven D'Aprano
On Mon, 24 Mar 2014 20:56:19 -0700, Rustom Mody wrote: > Paren vs tuples: why do we need to write (x,) not (x) You don't. You can write x, without the brackets: py> t = 23, py> type(t) It's the comma that makes tuples, not the brackets. -- Steven -- https://mail.python.org/mailman/listin

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Steven D'Aprano
On Tue, 25 Mar 2014 17:19:10 +1100, Chris Angelico wrote: > I'll write today's date as 20140325 in some contexts.) Of them, > y/m/d is both the clearest and the least commonly used; with a > four-digit year, there's no way it could be confused for anything else. Shame

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Chris Angelico
On Tue, Mar 25, 2014 at 6:03 PM, Steven D'Aprano wrote: > On Tue, 25 Mar 2014 17:19:10 +1100, Chris Angelico wrote: > >> I'll write today's date as 20140325 in some contexts.) Of them, >> y/m/d is both the clearest and the least commonly used; with a >> four

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 12:33:49 PM UTC+5:30, Steven D'Aprano wrote: > On Mon, 24 Mar 2014 20:56:19 -0700, Rustom Mody wrote: > > Paren vs tuples: why do we need to write (x,) not (x) > You don't. You can write x, without the brackets: > py> t = 23, > py> type(t) > It's the comma that makes

Re: Asyncio (or something better) for control of a vacuum system/components.

2014-03-25 Thread dieter
Shishir writes: > ... > I am writing a software to control and monitor a vacuum > furnace+attachments. It has a few mass flow controllers, a butterfly valve, > a labjack unit for analog/digital outputs etc. They use RS485, RS232 and > USB to communicate with the computer and follow special protoco

Re: gdb python how to output integer for examine memory

2014-03-25 Thread dieter
Wesley writes: > I am trying to use gdb debug python script. > I am using gdb7.7 and python2.7.6, here is my simple test script: > import time > > def next(i): > time.sleep(10) > i = 1 - i > > i = 1 > while True: > next(i) > When this script running, gdb attach to it, and here is s

Re: Memory error

2014-03-25 Thread dieter
Jamie Mitchell writes: > ... > I then get a memory error: > > Traceback (most recent call last): > File "", line 1, in > File "/usr/local/sci/lib/python2.7/site-packages/scipy/stats/stats.py", > line 2409, in pearsonr > x = np.asarray(x) > File "/usr/local/sci/lib/python2.7/site-packag

Re: Time we switched to unicode?

2014-03-25 Thread Marko Rauhamaa
Chris Angelico : > On Tue, Mar 25, 2014 at 4:14 PM, Mark H Harris wrote: > Π = pi > > That's good! (Although typing Π quicker than pi is majorly pushing it. It don't think that's good. The lower-case letter π should be used. The upper-case letter is used for a product, although unicode dedic

Re: gdb python how to output integer for examine memory

2014-03-25 Thread Wesley
在 2014年3月25日星期二UTC+8下午3时49分09秒,dieter写道: > Wesley writes: > > > > > I am trying to use gdb debug python script. > > > I am using gdb7.7 and python2.7.6, here is my simple test script: > > > import time > > > > > > def next(i): > > > time.sleep(10) > > > i = 1 - i > > > > > >

Re: Time we switched to unicode?

2014-03-25 Thread Chris Angelico
On Tue, Mar 25, 2014 at 7:05 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Tue, Mar 25, 2014 at 4:14 PM, Mark H Harris wrote: >> Π = pi >> >> That's good! (Although typing Π quicker than pi is majorly pushing it. > > It don't think that's good. The lower-case letter π should be used. T

Re: Time we switched to unicode?

2014-03-25 Thread Steven D'Aprano
On Tue, 25 Mar 2014 19:23:45 +1100, Chris Angelico wrote: > I was trying to avoid nit-picking What, on comp.lang.python? What's wrong with you? :-) -- Steven -- https://mail.python.org/mailman/listinfo/python-list

Re: Time we switched to unicode?

2014-03-25 Thread Chris Angelico
On Tue, Mar 25, 2014 at 7:59 PM, Steven D'Aprano wrote: > On Tue, 25 Mar 2014 19:23:45 +1100, Chris Angelico wrote: > >> I was trying to avoid nit-picking > > What, on comp.lang.python? What's wrong with you? > > > :-) I know, it's like refraining from bike-shedding on python-ideas or not reading

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Antoon Pardon
On 25-03-14 06:08, Chris Angelico wrote: > On Tue, Mar 25, 2014 at 4:00 PM, Rustom Mody wrote: >> Its already there -- and even easier >> Switch to cyrillic-jis-russian (whatever that is!) >> and I get л from k Л from K > How quickly can you switch, type one letter (to generate one Cyrillic > cha

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Chris Angelico
On Tue, Mar 25, 2014 at 8:43 PM, Antoon Pardon wrote: > I thought programs were read more than written. So if writing is made > a bit more problematic but the result is more readable because we are > able to use symbols that are already familiar from other contexts, I > would say it is worth it.

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-25 Thread 88888 Dihedral
> >>> x = [[1, 2], [3, 4]] > > >>> for x in x: > > ... for x in x: > > ... print(x) > This is valid in the syntax level in python. But it is only good for those writing obscure programs in my opinions at most team works. -- https://mail.python.org/mailman/listinfo/python-list

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Antoon Pardon
On 25-03-14 05:14, Chris Angelico wrote: > On Tue, Mar 25, 2014 at 2:56 PM, Rustom Mody >> I don't know about the difference between {} in set theory and Python, >>> but the multiple uses of () actually boil down to two: >> In set theory {} makes sets >> In python {} makes dictionaries > That's a b

[newbie] confusion concerning fetching an element in a 2d-array

2014-03-25 Thread Jean Dubois
I'm confused by the behaviour of the following python-script I wrote: #!/usr/bin/env python #I first made a data file 'test.dat' with the following content #1.0 2 3 #4 5 6.0 #7 8 9 import numpy as np lines=[line.strip() for line in open('test.dat')] #convert lines-list to numpy-array array_lines=n

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Antoon Pardon
On 25-03-14 10:54, Chris Angelico wrote: > On Tue, Mar 25, 2014 at 8:43 PM, Antoon Pardon > wrote: >> I thought programs were read more than written. So if writing is made >> a bit more problematic but the result is more readable because we are >> able to use symbols that are already familiar from

Have you ever wondered why there are so many flavors of python. This post answers all your queries.

2014-03-25 Thread Amit Khomane
http://www.techdarting.com/2014/03/why-different-flavors-of-python.html -- https://mail.python.org/mailman/listinfo/python-list

Re: [newbie] confusion concerning fetching an element in a 2d-array

2014-03-25 Thread Steven D'Aprano
On Tue, 25 Mar 2014 03:26:26 -0700, Jean Dubois wrote: > I'm confused by the behaviour of the following python-script I wrote: > > #!/usr/bin/env python > #I first made a data file 'test.dat' with the following content > #1.0 2 3 > #4 5 6.0 > #7 8 9 > import numpy as np > lines=[line.strip() for

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Chris Angelico
On Tue, Mar 25, 2014 at 9:24 PM, Antoon Pardon wrote: > No they didn't have to. With the transition to python3, the developers > could have opted for empty braces to mean an empty set. And if they > wanted a literal for an empty dictionary, they might have chosen {:}. > Backward-compatibility was

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Steven D'Aprano
On Tue, 25 Mar 2014 11:38:38 +0100, Antoon Pardon wrote: > On 25-03-14 10:54, Chris Angelico wrote: >> On Tue, Mar 25, 2014 at 8:43 PM, Antoon Pardon >> wrote: >>> I thought programs were read more than written. So if writing is made >>> a bit more problematic but the result is more readable beca

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Antoon Pardon
On 25-03-14 12:14, Steven D'Aprano wrote: > On Tue, 25 Mar 2014 11:38:38 +0100, Antoon Pardon wrote: > >> On 25-03-14 10:54, Chris Angelico wrote: >>> On Tue, Mar 25, 2014 at 8:43 PM, Antoon Pardon >>> wrote: I thought programs were read more than written. So if writing is made a bit mor

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Antoon Pardon
On 25-03-14 12:12, Chris Angelico wrote: > On Tue, Mar 25, 2014 at 9:24 PM, Antoon Pardon > wrote: >> No they didn't have to. With the transition to python3, the developers >> could have opted for empty braces to mean an empty set. And if they >> wanted a literal for an empty dictionary, they mig

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 5:16:14 PM UTC+5:30, Antoon Pardon wrote: > On 25-03-14 12:14, Steven D'Aprano wrote: > >> Would > >> such a use already indicate I should use a mathematical front-end? > >> When a programming language is borrowing concepts from mathematics, I > >> see no reason not to b

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Roy Smith
In article , Antoon Pardon wrote: > Come on. The problem isn't that both set and dictionary literal use > braces. That doesn't seem to be a problem in python3. The only question > was what should {} represent and how do we get an empty collection of > the other kind. If {} had been an empty set,

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Roy Smith
In article , Mark H Harris wrote: > On 3/24/14 10:51 PM, Chris Angelico wrote: > > Supporting both may look tempting, but you effectively create two ways > > of spelling the exact same thing; it'd be like C's trigraphs. Do you > > know what ??= is, > > This was a fit for me, back in the day IBM

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Roy Smith
In article , Mark H Harris wrote: > (we're on one tiny planet, you know?) Speak for yourself. -- https://mail.python.org/mailman/listinfo/python-list

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Chris Angelico
On Tue, Mar 25, 2014 at 11:07 PM, Antoon Pardon wrote: > On 25-03-14 12:12, Chris Angelico wrote: > >> On Tue, Mar 25, 2014 at 9:24 PM, Antoon Pardon >> wrote: >>> No they didn't have to. With the transition to python3, the developers >>> could have opted for empty braces to mean an empty set. An

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Roy Smith
In article <281c8ce1-4f03-4e93-b5cd-d45b85e89...@googlegroups.com>, Rustom Mody wrote: > And Chris is right in (rephrasing) we may have unicode-happy OSes and > languages. We cant reasonably have unicode-happy keyboards. > [What would a million-key keyboard look like? Lets leave the cost aside..

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 4:08:38 PM UTC+5:30, Antoon Pardon wrote: > So? We do use + -, so why shouldn't we use × for multiplication. Would > such a use already indicate I should use a mathematical front-end? > When a programming language is borrowing concepts from mathematics, > I see no reason

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Antoon Pardon
On 25-03-14 13:45, Chris Angelico wrote: > It makes the same notation mean different things, in ways that are > hard to render clearly. You can write a Py3 program and put this at > the top for Py2: > > try: > input = raw_input > range = xrange > except NameError: > # We're running on

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 6:15:16 PM UTC+5:30, Chris Angelico wrote: > On Tue, Mar 25, 2014 at 11:07 PM, Antoon Pardon > > On 25-03-14 12:12, Chris Angelico wrote: > >> On Tue, Mar 25, 2014 at 9:24 PM, Antoon Pardon > >>> No they didn't have to. With the transition to python3, the developers > >>>

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Chris Angelico
On Tue, Mar 25, 2014 at 11:35 PM, Roy Smith wrote: > When's the last time you saw somebody typing commands to a computer on > Star Trek? That's more like what comes up in Cars 2. "It's voice activated... but then, everything is these days!" ChrisA -- https://mail.python.org/mailman/listinfo/pyt

Re: advice on sub-classing multiprocessing.Process and multiprocessing.BaseManager

2014-03-25 Thread matt . newville
ChrisA - >> I wasn't really asking "is multiprocessing appropriate?" but whether >> there was a cleaner way to subclass multiprocessing.BaseManager() to >> use a subclass of Process(). I can believe the answer is No, but >> thought I'd ask. > > I've never subclassed BaseManager like this. It m

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Steven D'Aprano
On Tue, 25 Mar 2014 08:21:19 -0400, Roy Smith wrote: > In article , > Antoon Pardon wrote: > >> Come on. The problem isn't that both set and dictionary literal use >> braces. That doesn't seem to be a problem in python3. The only question >> was what should {} represent and how do we get an emp

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Antoon Pardon
On 25-03-14 13:53, Rustom Mody wrote: > On Tuesday, March 25, 2014 4:08:38 PM UTC+5:30, Antoon Pardon wrote: >> So? We do use + -, so why shouldn't we use × for multiplication. Would >> such a use already indicate I should use a mathematical front-end? >> When a programming language is borrowing co

Re: [newbie] confusion concerning fetching an element in a 2d-array

2014-03-25 Thread Jean Dubois
Op dinsdag 25 maart 2014 12:01:37 UTC+1 schreef Steven D'Aprano: > On Tue, 25 Mar 2014 03:26:26 -0700, Jean Dubois wrote: > > > I'm confused by the behaviour of the following python-script I wrote: > > > > #!/usr/bin/env python > > #I first made a data file 'test.dat' with the following content >

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Chris Angelico
On Wed, Mar 26, 2014 at 12:43 AM, Antoon Pardon wrote: >> It doesn't bother me. IIRC in primary school before fractions were >> introduced, >> a colon was used to indicate division. The way I learned it, a colon was for a ratio, and a horizontal line was for a fraction. Both of them effectively

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Chris Angelico
On Wed, Mar 26, 2014 at 12:07 AM, Rustom Mody wrote: > What you are answering (2) is somewhat different from what Anton is asking > (1). > > 1. Use a tool (2to3 inspired) to help move programs to the the new lexicon > 2. Use 2to3 to (help) write code that is backward-compatible > > It is an invar

Re: advice on sub-classing multiprocessing.Process and multiprocessing.BaseManager

2014-03-25 Thread Chris Angelico
On Wed, Mar 26, 2014 at 12:34 AM, wrote: > Monkey-patching multiprocessing.Process seems more fragile than subclassing > it. It turned out that multiprocessing.pool.Pool was also very easy to > subclass. But cleanly subclassing the Managers in multiprocessing.managers > look much harder. I'

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Antoon Pardon
On 25-03-14 14:36, Steven D'Aprano wrote: > On Tue, 25 Mar 2014 08:21:19 -0400, Roy Smith wrote: > >> In article , >> Antoon Pardon wrote: >> >>> Come on. The problem isn't that both set and dictionary literal use >>> braces. That doesn't seem to be a problem in python3. The only question >>> was

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 7:26:47 PM UTC+5:30, Chris Angelico wrote: > On Wed, Mar 26, 2014 at 12:43 AM, Antoon Pardon > >> It doesn't bother me. IIRC in primary school before fractions were > >> introduced, > >> a colon was used to indicate division. > The way I learned it, a colon was for a ra

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 7:13:09 PM UTC+5:30, Antoon Pardon wrote: > On 25-03-14 13:53, Rustom Mody wrote: > > On Tuesday, March 25, 2014 4:08:38 PM UTC+5:30, Antoon Pardon wrote: > >> So? We do use + -, so why shouldn't we use × for multiplication. Would > >> such a use already indicate I should

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Steven D'Aprano
On Tue, 25 Mar 2014 08:35:02 -0400, Roy Smith wrote: > In article <281c8ce1-4f03-4e93-b5cd-d45b85e89...@googlegroups.com>, > Rustom Mody wrote: > >> And Chris is right in (rephrasing) we may have unicode-happy OSes and >> languages. We cant reasonably have unicode-happy keyboards. [What would >

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Chris Angelico
On Wed, Mar 26, 2014 at 1:13 AM, Steven D'Aprano wrote: > On Tue, 25 Mar 2014 08:35:02 -0400, Roy Smith wrote: > >> In article <281c8ce1-4f03-4e93-b5cd-d45b85e89...@googlegroups.com>, >> Rustom Mody wrote: >> >>> And Chris is right in (rephrasing) we may have unicode-happy OSes and >>> languages

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Steven D'Aprano
On Tue, 25 Mar 2014 05:53:45 -0700, Rustom Mody wrote: > And if we had hyphen '‐' distinguished from minus '-' then we could have > lispish names like call‐with‐current‐continuation properly spelt. And > then generations of programmers will thank us for increasing their > debugging overtime!! :-)

Re: [newbie] confusion concerning fetching an element in a 2d-array

2014-03-25 Thread Dave Angel
Jean Dubois Wrote in message: > Op dinsdag 25 maart 2014 12:01:37 UTC+1 schreef Steven D'Aprano: >> >> py> values = [float(s) for s in data.split()] >> py> print values >> [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] >> py> array_lines = np.array(values) >> py> array_lines = array_lines.reshape

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Steven D'Aprano
On Tue, 25 Mar 2014 05:09:20 -0700, Rustom Mody wrote: > Two completely separate questions > > 1. Symbols outside of US-104-keyboard/ASCII used for python >functions/constants > 2. Non-linear math notation > > It goes back not just to the first programming languages but to Turing's > paper t

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 7:53:23 PM UTC+5:30, Steven D'Aprano wrote: > On Tue, 25 Mar 2014 05:53:45 -0700, Rustom Mody wrote: > > And if we had hyphen '‐' distinguished from minus '-' then we could have > > lispish names like call‐with‐current‐continuation properly spelt. And > > then generation

Re: [newbie] confusion concerning fetching an element in a 2d-array

2014-03-25 Thread Steven D'Aprano
On Tue, 25 Mar 2014 06:47:23 -0700, Jean Dubois wrote: [...] > Thanks for answering my question but unfortunately now I'm totally > confused. > Above I see parts from different programs which I can't assemble > together to one working program (I really tried hard). Can I tell from > your comment I

Re: [newbie] confusion concerning fetching an element in a 2d-array

2014-03-25 Thread Peter Otten
Jean Dubois wrote: > Op dinsdag 25 maart 2014 12:01:37 UTC+1 schreef Steven D'Aprano: >> On Tue, 25 Mar 2014 03:26:26 -0700, Jean Dubois wrote: >> >> > I'm confused by the behaviour of the following python-script I wrote: >> > >> > #!/usr/bin/env python >> > #I first made a data file 'test.dat' w

Re: [newbie] confusion concerning fetching an element in a 2d-array

2014-03-25 Thread Mark H Harris
On 3/25/14 9:42 AM, Dave Angel wrote: All I need is a little python-example reading a file with e.g. three lines with three numbers per line and putting those numbers as floats in a 3x3-numpy_array, then selecting an element from that numpy_array using it's row and column-number. If your instr

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Mark H Harris
On 3/25/14 7:36 AM, Roy Smith wrote: (we're on one tiny planet, you know?) Speak for yourself. Are others on this list, um, on a different planet? Or, am I the only one who knows its tiny? Yes, we're on a tiny planet revolving around a speck of a star, at the edge of an insignificant

Re: How to clear all content in a Tk()

2014-03-25 Thread Marcel Rodrigues
What about this: Put a Frame() inside the root: `frame = Frame(root)`. This frame will be the only immediate child of root. Everything else will be put inside the frame. When you need to clear the root, call `frame.destroy()`. This will destroy `frame` and all its children. You will need to recrea

Re: Time we switched to unicode?

2014-03-25 Thread Chris “Kwpolska” Warrick
On Tue, Mar 25, 2014 at 9:05 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Tue, Mar 25, 2014 at 4:14 PM, Mark H Harris wrote: >> Π¹ = pi >> >> That's good! (Although typing Π¹ quicker than pi is majorly pushing it. > > It don't think that's good. The lower-case letter π² should be used

Re: python installation on windows

2014-03-25 Thread rborole06
On Tuesday, 25 March 2014 10:16:20 UTC-8, rbor...@gmail.com wrote: > On Sunday, 23 March 2014 18:22:54 UTC-8, Rhodri James wrote: > > > On Sun, 23 Mar 2014 17:09:09 -, wrote: > > > > > > > > > > > > > Hi Everybody > > > > > > > > > > > > > > actually i want to run python on web

Re: python installation on windows

2014-03-25 Thread rborole06
On Sunday, 23 March 2014 18:22:54 UTC-8, Rhodri James wrote: > On Sun, 23 Mar 2014 17:09:09 -, wrote: > > > > > Hi Everybody > > > > > > actually i want to run python on web browser. > > > > Actually you don't. You want to run Python on a web server, which > > fortunately is a goo

Re: python installation on windows

2014-03-25 Thread rborole06
On Sunday, 23 March 2014 13:07:28 UTC-8, tad na wrote: > On Sunday, March 23, 2014 12:33:02 PM UTC-5, tad na wrote: > > > On Sunday, March 23, 2014 12:09:09 PM UTC-5, rbor...@gmail.com wrote: > > > > Hi Everybody > > > > actually i want to run python on web browser. I downloaded python and > >

Re: python installation on windows

2014-03-25 Thread rborole06
On Sunday, 23 March 2014 19:35:19 UTC-8, Chris Angelico wrote: > On Mon, Mar 24, 2014 at 2:28 PM, Mark H Harris wrote: > > > Anyway, the PSF runs python (the interpreter) from a web server (I can > > > access the python interpreter from my browser from the PSF site). > > > > > > How is that d

unicode as valid naming symbols

2014-03-25 Thread Mark H Harris
greetings, I would like to create a lamda as follows: √ = lambda n: sqrt(n) On my keyboard mapping the "problem" character is alt-v which produces the radical symbol. When trying to set the symbol as a name within the name-space gives a syntax error: >>> from math import sqrt >>> >>> √ = la

Re: [newbie] confusion concerning fetching an element in a 2d-array

2014-03-25 Thread Jean Dubois
Op dinsdag 25 maart 2014 17:12:12 UTC+1 schreef Peter Otten: > Jean Dubois wrote: > > Op dinsdag 25 maart 2014 12:01:37 UTC+1 schreef Steven D'Aprano: > >> On Tue, 25 Mar 2014 03:26:26 -0700, Jean Dubois wrote: > >> > >> > I'm confused by the behaviour of the following python-script I wrote: > >> >

Re: unicode as valid naming symbols

2014-03-25 Thread wxjmfauth
Le mardi 25 mars 2014 19:30:34 UTC+1, Mark H. Harris a écrit : > greetings, I would like to create a lamda as follows: > > > > √ = lambda n: sqrt(n) > > > > > > On my keyboard mapping the "problem" character is alt-v which produces > > the radical symbol. When trying to set the symbol as

Re: [newbie] confusion concerning fetching an element in a 2d-array

2014-03-25 Thread Jean Dubois
Op dinsdag 25 maart 2014 15:42:13 UTC+1 schreef Dave Angel: > Jean Dubois Wrote in message: > > Op dinsdag 25 maart 2014 12:01:37 UTC+1 schreef Steven D'Aprano: > >> > >> py> values = [float(s) for s in data.split()] > >> py> print values > >> [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] > >> py>

Re: python installation on windows

2014-03-25 Thread Mark Lawrence
On 25/03/2014 18:17, rborol...@gmail.com wrote: Would you please use the mailing list https://mail.python.org/mailman/listinfo/python-list or read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing double line spacing and single line paragraphs, thanks. -- M

Re: unicode as valid naming symbols

2014-03-25 Thread MRAB
On 2014-03-25 18:30, Mark H Harris wrote: greetings, I would like to create a lamda as follows: √ = lambda n: sqrt(n) On my keyboard mapping the "problem" character is alt-v which produces the radical symbol. When trying to set the symbol as a name within the name-space gives a syntax error:

Re: unicode as valid naming symbols

2014-03-25 Thread Mark H Harris
On 3/25/14 1:52 PM, wxjmfa...@gmail.com wrote: '√'.isidentifier() > False 'λ'.isidentifier() > True > S.isidentifier() -> bool > > Return True if S is a valid identifier according > to the language definition. > > cf "unicode.org" doc Excellent, thanks! marcus -- https://mail.py

Re: unicode as valid naming symbols

2014-03-25 Thread Mark H Harris
On 3/25/14 2:24 PM, MRAB wrote: > It's explained in PEP 3131. > > Basically, a name should to start with a letter (this has been extended > to include Chinese characters, etc) or an underscore. > > λ is a classified as Lowercase_Letter. > > √ is classified as Math_Symbol. Thanks much! I'll no

Re: Time we switched to unicode?

2014-03-25 Thread Chris Angelico
On Wed, Mar 26, 2014 at 4:24 AM, Chris “Kwpolska” Warrick wrote: > “If you can type an N-ARY PRODUCT, you can type a GREEK SMALL LETTER > PI, unless there’s something very weird going on.” > > …like, the user is in the past and is using ISO 8859-7 (instead of a > 21st-century encoding, like UTF-8)

Re:unicode as valid naming symbols

2014-03-25 Thread Dave Angel
Mark H Harris Wrote in message: > greetings, I would like to create a lamda as follows: > > √ = lambda n: sqrt(n) > > > On my keyboard mapping the "problem" character is alt-v which produces > the radical symbol. When trying to set the symbol as a name within the > name-space gives a synta

Re: [newbie] confusion concerning fetching an element in a 2d-array

2014-03-25 Thread Joel Goldstick
Jean, be aware there is also python tutor list you might like. This is sometimes a tough crowd here. Don't be discouraged. It can be a badge of honor sometimes -- https://mail.python.org/mailman/listinfo/python-list

Re: unicode as valid naming symbols

2014-03-25 Thread Marko Rauhamaa
Mark H Harris : >Thanks much! I'll note that for improvements. Any unicode symbol > (that is not a number) should be allowed as an identifier. I don't know if that's a good idea, but that's how it is in lisp/scheme. Thus, "*" and "1+" are normal identifiers in lisp and scheme. Marko -- h

Re: unicode as valid naming symbols

2014-03-25 Thread Ian Kelly
On Tue, Mar 25, 2014 at 1:29 PM, Mark H Harris wrote: > On 3/25/14 2:24 PM, MRAB wrote: >> It's explained in PEP 3131. >> >> Basically, a name should to start with a letter (this has been extended >> to include Chinese characters, etc) or an underscore. >> >> λ is a classified as Lowercase_Letter.

Re: unicode as valid naming symbols

2014-03-25 Thread Skip Montanaro
On Tue, Mar 25, 2014 at 2:48 PM, Marko Rauhamaa wrote: > I don't know if that's a good idea, but that's how it is in lisp/scheme. > > Thus, "*" and "1+" are normal identifiers in lisp and scheme. But parsing Lisp is pretty trivial. Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: [newbie] confusion concerning fetching an element in a 2d-array

2014-03-25 Thread Dave Angel
Jean Dubois Wrote in message: > Op dinsdag 25 maart 2014 15:42:13 UTC+1 schreef Dave Angel: >> If your instructor wanted you to copy examples, he would have >> given you one. > please Dave leave that belittling tone behind, there's no instructor > whatsoever involved here. It wasn't my inten

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Gregory Ewing
Roy Smith wrote: Doors that open automatically as you approach them are now routine. Star Trek doors seem to be a bit smarter, though. Captain Kirk never had to stop in front of a door and wait for it to sluggishly slide open. Also the doors never open when you're just walking past and not inte

Re: unicode as valid naming symbols

2014-03-25 Thread Tim Chase
On 2014-03-25 14:29, Mark H Harris wrote: > > It's explained in PEP 3131. > > > > Basically, a name should to start with a letter (this has been > > extended to include Chinese characters, etc) or an underscore. > > > > λ is a classified as Lowercase_Letter. > > > > √ is classified as Math_

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Larry Martell
On Tue, Mar 25, 2014 at 4:21 PM, Gregory Ewing wrote: > Roy Smith wrote: > >> Doors that open automatically as you approach them are now routine. >> > > Star Trek doors seem to be a bit smarter, though. > Captain Kirk never had to stop in front of a door > and wait for it to sluggishly slide open.

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Gregory Ewing
Rustom Mody wrote: ÷ for some reason seems inappropriate (some vague recollection that its an only English; Europeans dont use it??) To me it's something you learn in primary school and then grow out of when you start doing "real" mathematics. The "/" is actually a better approximation of what

[ANN] pathlib 1.0

2014-03-25 Thread Antoine Pitrou
Hello, I am announcing the release of pathlib 1.0. This version brings pathlib up to date with the official Python 3.4 release, and also fixes a couple of 2.7-specific issues. Detailed changelog can be found further below. In the future, I expect the standalone (PyPI) version of pathlib to re

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Gregory Ewing
Chris Angelico wrote: But you can't do the same for braces. You'd have to eschew *both* literal-ish notations and use explicit constructors everywhere. Not clean. This could have been dealt with by giving Python 2.7 a "from __future__ import braces_mean_sets" option or something like that. But

Re: [ANN] pathlib 1.0

2014-03-25 Thread Antoine Pitrou
Oh, and of course it is published on PyPI: https://pypi.python.org/pypi/pathlib/ Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Gregory Ewing
Chris Angelico wrote: Hey look, we have a rogue AI... "CONSOLE!"... Except that any rogue AI who's at all serious about the matter would take care of that little loophole at an early stage. "Open the pod bay doors, HAL." "I'm afraid I can't do that, Dave." "CONSOLE!" "Sorry, Dave. Nice try,

Errors on text.get()

2014-03-25 Thread eneskristo
Exception in Tkinter callback Traceback (most recent call last): File "C:\Python33\lib\tkinter\__init__.py", line 1475, in __call__ return self.func(*args) File "C:/Users/User/PycharmProjects/Cesarian Codes/project.py", line 43, in gen_random string = text.get('1.0', 'end') File "C:\

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Mark Lawrence
On 25/03/2014 20:21, Gregory Ewing wrote: Roy Smith wrote: Doors that open automatically as you approach them are now routine. Star Trek doors seem to be a bit smarter, though. Captain Kirk never had to stop in front of a door and wait for it to sluggishly slide open. Also the doors never open

Re: Errors on text.get()

2014-03-25 Thread Peter Otten
eneskri...@gmail.com wrote: > Exception in Tkinter callback > Traceback (most recent call last): > File "C:\Python33\lib\tkinter\__init__.py", line 1475, in __call__ > return self.func(*args) > File "C:/Users/User/PycharmProjects/Cesarian Codes/project.py", line 43, > in gen_random >

Re: unicode as valid naming symbols

2014-03-25 Thread Cameron Simpson
On 25Mar2014 21:48, Marko Rauhamaa wrote: > Mark H Harris : > >Thanks much! I'll note that for improvements. Any unicode symbol > > (that is not a number) should be allowed as an identifier. > > I don't know if that's a good idea, but that's how it is in lisp/scheme. I think it is a terribl

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Terry Reedy
On 3/25/2014 2:50 AM, Chris Angelico wrote: On Tue, Mar 25, 2014 at 5:41 PM, Rustom Mody wrote: ALl of which is isomorphic to Steven's point that forty is less eyeballable than 40 And mine that ∅ is more eyeballable than set([]) I don't disagree that it is; the short tokens are easier to rea

Re: unicode as valid naming symbols

2014-03-25 Thread Ethan Furman
On 03/25/2014 12:29 PM, Mark H Harris wrote: On 3/25/14 2:24 PM, MRAB wrote: It's explained in PEP 3131. Basically, a name should to start with a letter (this has been extended to include Chinese characters, etc) or an underscore. λ is a classified as Lowercase_Letter. √ is classified as Math

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Terry Reedy
On 3/25/2014 11:18 AM, Steven D'Aprano wrote: The thing is, we can't just create a ∑ function, because it doesn't work the way the summation operator works. The problem is that we would want syntactic support, so we could write something like this: p = 2 ∑(n, 1, 10, n**p) Of course

Re: unicode as valid naming symbols

2014-03-25 Thread Steven D'Aprano
On Tue, 25 Mar 2014 14:29:06 -0500, Mark H Harris wrote: > On 3/25/14 2:24 PM, MRAB wrote: > > It's explained in PEP 3131. > > > > Basically, a name should to start with a letter (this has been > > extended to include Chinese characters, etc) or an underscore. > > > > λ is a classified as Lo

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Steven D'Aprano
On Tue, 25 Mar 2014 19:55:39 -0400, Terry Reedy wrote: > On 3/25/2014 11:18 AM, Steven D'Aprano wrote: > >> The thing is, we can't just create a ∑ function, because it doesn't >> work the way the summation operator works. The problem is that we would >> want syntactic support, so we could write s

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Terry Reedy
On 3/25/2014 8:07 AM, Antoon Pardon wrote: On 25-03-14 12:12, Chris Angelico wrote: On Tue, Mar 25, 2014 at 9:24 PM, Antoon Pardon wrote: No they didn't have to. With the transition to python3, the developers could have opted for empty braces to mean an empty set. And if they wanted a literal

YADTR (Yet Another DateTime Rant)

2014-03-25 Thread Roy Smith
One of my roles on this newsgroup is to periodically whine about stupidities in the Python datetime module. This is one of those times. I have some code which computes how long ago the sun set. Being a nice pythonista, I'm using a timedelta to represent this value. It would be difficult to i

Re: Time we switched to unicode?

2014-03-25 Thread Steven D'Aprano
On Tue, 25 Mar 2014 18:24:10 +0100, Chris “Kwpolska” Warrick wrote: > Oh: and speaking of fancy Unicode characters that are worthless > ~duplicates, spot the difference here: > > µ μ I take exception to your description of them as *worthless* duplicates. "Unfortunate" would be a better choice o

Re: YADTR (Yet Another DateTime Rant)

2014-03-25 Thread Ethan Furman
On 03/25/2014 05:58 PM, Roy Smith wrote: One of my roles on this newsgroup is to periodically whine about stupidities in the Python datetime module. This is one of those times. I have some code which computes how long ago the sun set. Being a nice pythonista, I'm using a timedelta to represent

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Terry Reedy
On 3/25/2014 9:36 AM, Steven D'Aprano wrote: Yes, Python could have changed the meaning of {} to mean the empty set. But you know what? The empty set is not that important. Sets are not fundamental to Python. Python didn't even have sets until 2.3, and at first they were just a standard library

Re: unicode as valid naming symbols

2014-03-25 Thread Rustom Mody
On Wednesday, March 26, 2014 12:22:40 AM UTC+5:30, wxjm...@gmail.com wrote: > Le mardi 25 mars 2014 19:30:34 UTC+1, Mark H. Harris a écrit : > > greetings, I would like to create a lamda as follows: > > √ = lambda n: sqrt(n) > > On my keyboard mapping the "problem" character is alt-v which produces

Re: Have you ever wondered why there are so many flavors of python. This post answers all your queries.

2014-03-25 Thread Terry Reedy
On 3/25/2014 6:52 AM, Amit Khomane wrote: http://www.techdarting.com/2014/03/why-different-flavors-of-python.html This is about implementations: CPython, Jython, etc. I am not sure it actually answers Why? -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: unicode as valid naming symbols

2014-03-25 Thread Terry Reedy
On 3/25/2014 2:30 PM, Mark H Harris wrote: greetings, I would like to create a lamda as follows: A lambda is a function lacking a proper name. √ = lambda n: sqrt(n) This is discouraged in PEP8. If the following worked, def √(n): return sqrt(n) would have √ as its __name__ attribute -- Te

  1   2   >