Re: Stefan's headers [was:Names and identifiers]

2018-06-11 Thread Chris Angelico
On Tue, Jun 12, 2018 at 4:32 PM, Gregory Ewing wrote: > There are some historical and present-day facts that don't > support that idea. > > * Software existed in the days before it became seen as > something to be sold for money per-copy. Both computer > companies and programmers seemed to to all

Re: Stefan's headers [was:Names and identifiers]

2018-06-11 Thread Gregory Ewing
Chris Angelico wrote: The bit you trimmed out was: If the business model had always been "sell hardware, it comes fully programmed", what would bring people to try to create third-party software at all? Maybe because they want to do things with the machine that the manufacturer didn't antici

Re: Posting warning message

2018-06-11 Thread T Berger
On Monday, June 11, 2018 at 7:24:58 PM UTC-4, Gregory Ewing wrote: > Tamara Berger wrote: > > I typed these 2 lines in the terminal: > > > > 192:~ TamaraB$ sudo python3 > > ... > python3 -m pip install pytest > > You need to enter this *single* line in the Terminal: > > sudo python3 -m

Re: Stefan's headers [was:Names and identifiers]

2018-06-11 Thread Chris Angelico
On Tue, Jun 12, 2018 at 8:24 AM, Rick Johnson wrote: > On Monday, June 11, 2018 at 3:04:14 PM UTC-5, MRAB wrote: >> The software is more like the fuel. > > How so? > > (01) Can energy be extracted from software? Yes, absolutely. > (02) If so, at what rate is software depleted as the hardware >

Re: Index of entity in List with a Condition

2018-06-11 Thread Rick Johnson
subhaba...@gmail.com wrote: > I have the following sentence, > > "Donald Trump is the president of United States of America". > > I am trying to extract the index 'of', not only for single but also > for its multi-occurance (if they occur), from the list of words of the > string, made by simply

Re: Posting warning message

2018-06-11 Thread Gregory Ewing
Tamara Berger wrote: I typed these 2 lines in the terminal: 192:~ TamaraB$ sudo python3 > ... python3 -m pip install pytest You need to enter this *single* line in the Terminal: sudo python3 -m pip install pytest What does the "-m" stand for in the line of code? It's a cmmand-line op

Re: Stefan's headers [was:Names and identifiers]

2018-06-11 Thread Rick Johnson
On Monday, June 11, 2018 at 3:04:14 PM UTC-5, MRAB wrote: > On 2018-06-11 20:17, Rick Johnson wrote: [...] > > A dashboard is a horrible analogy. Software and hardware > > are connected at the _hip_. A more correct analogy to > > describe the relationship between computer hardware and > > computer

Re: Stefan's headers [was:Names and identifiers]

2018-06-11 Thread Alister via Python-list
On Mon, 11 Jun 2018 21:03:59 +0100, MRAB wrote: > On 2018-06-11 20:17, Rick Johnson wrote: >> On Monday, June 11, 2018 at 1:02:15 PM UTC-5, Chris Angelico wrote: >> >>> You're trying to argue against my hypothetical statements about game >>> publishing, and declaring that it's possible to use sof

Re: Posting warning message

2018-06-11 Thread Cameron Simpson
On 11Jun2018 11:54, Tamara Berger wrote: I did subscribe to the mailing list, but it opened the floodgates to a torrent of irrelevant emails. I didn't know how to turn the flood off, so I unsubscribed. How do I set the appropriate option? My personal approach is to add a filter for list messag

Index of entity in List with a Condition

2018-06-11 Thread subhabangalore
I have the following sentence, "Donald Trump is the president of United States of America". I am trying to extract the index 'of', not only for single but also for its multi-occurance (if they occur), from the list of words of the string, made by simply splitting the sentence. index1=[index for

Re: How to install matplotlib in Debian 9

2018-06-11 Thread Tomasz Rola
On Mon, Jun 11, 2018 at 03:43:43PM -0300, Markos wrote: > [...] > As I prefer more stability than "updability" I will install the package: > > apt-get install python3-matplotlib > > Best Regards, > Markos Good choice IMHO. The "stable" in Debian is simply "supposed to work without problem". Pac

Re: Stefan's headers [was:Names and identifiers]

2018-06-11 Thread MRAB
On 2018-06-11 20:17, Rick Johnson wrote: On Monday, June 11, 2018 at 1:02:15 PM UTC-5, Chris Angelico wrote: You're trying to argue against my hypothetical statements about game publishing, and declaring that it's possible to use software to encourage hardware sales. But my point was that, abse

Re: Stefan's headers [was:Names and identifiers]

2018-06-11 Thread Chris Angelico
On Tue, Jun 12, 2018 at 5:17 AM, Rick Johnson wrote: > On Monday, June 11, 2018 at 1:02:15 PM UTC-5, Chris Angelico wrote: > >> You're trying to argue against my hypothetical statements >> about game publishing, and declaring that it's possible to >> use software to encourage hardware sales. But m

Re: Stefan's headers [was:Names and identifiers]

2018-06-11 Thread Rick Johnson
On Monday, June 11, 2018 at 1:02:15 PM UTC-5, Chris Angelico wrote: > You're trying to argue against my hypothetical statements > about game publishing, and declaring that it's possible to > use software to encourage hardware sales. But my point was > that, absent copyright and the ability to make

Re: How to install matplotlib in Debian 9

2018-06-11 Thread Markos
Em 08-06-2018 20:11, Jim Lee escreveu: On 06/08/2018 11:54 AM, Markos wrote: Hi, I'm starting my studies with Python 3 on Debian 9 that I just installed. I have to install the matplotlib module, but I am in doubt what is the difference of the commands: pip3 install matplotlib or apt-ge

Re: Stefan's headers [was:Names and identifiers]

2018-06-11 Thread Chris Angelico
On Mon, Jun 11, 2018 at 6:21 AM, Chris Angelico wrote: > On Sun, Jun 10, 2018 at 11:03 PM, Gregory Ewing > wrote: >> Chris Angelico wrote: >>> >>> You cannot, to >>> my knowledge, publish a game for the PS4 or Xbox 360 without >>> permission from Nintendo or Microsoft. >> >> >> That's because, si

Re: Posting warning message

2018-06-11 Thread MRAB
On 2018-06-11 16:54, Tamara Berger wrote: I did subscribe to the mailing list, but it opened the floodgates to a torrent of irrelevant emails. I didn't know how to turn the flood off, so I unsubscribed. How do I set the appropriate option? I was just going to post another message to google group

Re: Sorting NaNs

2018-06-11 Thread Anders Munch
Steven D'Aprano: It is not a guess if the user explicitly specifies that as the behaviour. If that was the context, sure, no problem. - Anders -- https://mail.python.org/mailman/listinfo/python-list

Re: Posting warning message

2018-06-11 Thread Tamara Berger
Apropos my earlier message: Before I post a question, I search online for an answer. Though I try all combinations of search terms, I get irrelevant results. Do you have a suggestion on how to frame searches? Tamara On Mon, Jun 11, 2018 at 4:32 AM Cameron Simpson wrote: > > On 10Jun2018 23:38, T

Re: Posting warning message

2018-06-11 Thread Tamara Berger
I did subscribe to the mailing list, but it opened the floodgates to a torrent of irrelevant emails. I didn't know how to turn the flood off, so I unsubscribed. How do I set the appropriate option? I was just going to post another message to google groups. If you don't mind, I'll ask you now. I g

Re: Question : Input after all prompts in python

2018-06-11 Thread Steven D'Aprano
On Mon, 11 Jun 2018 07:19:15 -0700, mohan4h wrote: > print(u"\u001b[{}A".format(n), flush=True, end="") > ^ > SyntaxError :invalid syntax My crystal ball tell me you are using Python 2. Is that right? -- Steven D'Aprano "Ever since I learne

Re: Question : Input after all prompts in python

2018-06-11 Thread Wolfgang Maier
On 06/11/2018 04:19 PM, moha...@gmail.com wrote: BTW i tried the code above, but i encountered a syntax error. print(u"\u001b[{}A".format(n), flush=True, end="") ^ SyntaxError :invalid syntax That's probably because you have been running

Re: Question : Input after all prompts in python

2018-06-11 Thread mohan4h
On Monday, June 11, 2018 at 9:13:04 PM UTC+8, Karsten Hilbert wrote: > On Mon, Jun 11, 2018 at 02:52:53PM +0200, Peter Otten wrote: > > > If the above hack works in the OP's environment it's certainly as easy as > > it > > can get; he just has to copy the up() and right() functions, and maybe >

Re: Question : Input after all prompts in python

2018-06-11 Thread Karsten Hilbert
On Mon, Jun 11, 2018 at 02:52:53PM +0200, Peter Otten wrote: > If the above hack works in the OP's environment it's certainly as easy as it > can get; he just has to copy the up() and right() functions, and maybe adapt > the arguments. > > The learning curve for tkinter or curses is steep by co

Re: Why exception from os.path.exists()?

2018-06-11 Thread Antoon Pardon
On 11-06-18 13:59, Steven D'Aprano wrote: > On Mon, 11 Jun 2018 09:55:06 +0200, Antoon Pardon wrote: > >> On 11-06-18 02:28, Steven D'Aprano wrote: > [...] >>> open(foo) raises an exception if foo doesn't exist; >>> >>> os.path.exists(foo) returns False if foo doesn't exist. >> That is not

Re: Question : Input after all prompts in python

2018-06-11 Thread Peter Otten
Karsten Hilbert wrote: > On Mon, Jun 11, 2018 at 02:14:26PM +0200, Peter Otten wrote: > >> >> print("1. Enter your name :") >> >> print("2. Enter your age :") >> >> print("3. Enter your gender :") >> >> name = input("") >> >> age = input("") >> >> gender = input("") >> > >> > That doesn't solve

Re: Question : Input after all prompts in python

2018-06-11 Thread Karsten Hilbert
On Mon, Jun 11, 2018 at 02:14:26PM +0200, Peter Otten wrote: > >> print("1. Enter your name :") > >> print("2. Enter your age :") > >> print("3. Enter your gender :") > >> name = input("") > >> age = input("") > >> gender = input("") > > > > That doesn't solve the "next to" part in > > > > get i

Re: Why exception from os.path.exists()?

2018-06-11 Thread Steven D'Aprano
On Mon, 11 Jun 2018 12:31:09 +0200, Peter J. Holzer wrote: > On 2018-06-11 01:06:37 +, Steven D'Aprano wrote: >> On Sun, 10 Jun 2018 23:57:35 +0200, Peter J. Holzer wrote: > > [Note: I was talking about os.stat here, not os.path.exists. I agree > that os.path.exists (and the other boolean fun

Re: Question : Input after all prompts in python

2018-06-11 Thread Peter Otten
Karsten Hilbert wrote: > On Mon, Jun 11, 2018 at 11:16:39AM +, Steven D'Aprano wrote: > >> > I want to prompt 3 questions together and then get input for the first >> > question next to question as below. >> > >> > 1. Enter your name : _ >> > 2. Enter your age : >> > 3. Enter your gender : >

Re: Why exception from os.path.exists()?

2018-06-11 Thread Steven D'Aprano
On Mon, 11 Jun 2018 09:55:06 +0200, Antoon Pardon wrote: > On 11-06-18 02:28, Steven D'Aprano wrote: [...] >> open(foo) raises an exception if foo doesn't exist; >> >> os.path.exists(foo) returns False if foo doesn't exist. > > That is not correct. The path can exist and os.path.exists st

Re: Question : Input after all prompts in python

2018-06-11 Thread Karsten Hilbert
On Mon, Jun 11, 2018 at 11:16:39AM +, Steven D'Aprano wrote: > > I want to prompt 3 questions together and then get input for the first > > question next to question as below. > > > > 1. Enter your name : _ > > 2. Enter your age : > > 3. Enter your gender : > > > > After showing the below pr

Re: Why exception from os.path.exists()?

2018-06-11 Thread Marko Rauhamaa
"Peter J. Holzer" : > On 2018-06-11 01:06:37 +, Steven D'Aprano wrote: >> Baking a limitation of some file systems into the high-level >> interface is simply a *bad idea*. > > We aren't talking about a high-level interface here. Call it high-level or not, we *are* talking about an interface (

Re: Question : Input after all prompts in python

2018-06-11 Thread Steven D'Aprano
On Mon, 11 Jun 2018 01:44:19 -0700, mohan4h wrote: > Everyone, > > I am very new to python. I am trying to achieve the below in it, but i > am unable to find suitable documentation to guide me on the same. > > I want to prompt 3 questions together and then get input for the first > question next

Re: Why exception from os.path.exists()?

2018-06-11 Thread Peter J. Holzer
On 2018-06-11 01:06:37 +, Steven D'Aprano wrote: > On Sun, 10 Jun 2018 23:57:35 +0200, Peter J. Holzer wrote: [Note: I was talking about os.stat here, not os.path.exists. I agree that os.path.exists (and the other boolean functions) should simply return false] > > I think this is worth keepin

Re: Why exception from os.path.exists()?

2018-06-11 Thread Antoon Pardon
On 11-06-18 10:35, Marko Rauhamaa wrote: > Antoon Pardon : >> On 11-06-18 02:28, Steven D'Aprano wrote: >>> The *whole point* of o.p.exists is to return False, not raise an >>> exception. >> And the price is that it will not always give the correct answer. > Yes, but that's still the point of the f

Re: Question : Input after all prompts in python

2018-06-11 Thread Karsten Hilbert
On Mon, Jun 11, 2018 at 01:44:19AM -0700, moha...@gmail.com wrote: > I am very new to python. I am trying to achieve the below in it, but i am > unable to find suitable documentation to guide me on the same. > > I want to prompt 3 questions together and then get input for the first > question n

Question : Input after all prompts in python

2018-06-11 Thread mohan4h
Everyone, I am very new to python. I am trying to achieve the below in it, but i am unable to find suitable documentation to guide me on the same. I want to prompt 3 questions together and then get input for the first question next to question as below. 1. Enter your name : _ 2. Enter your age

Re: Why exception from os.path.exists()?

2018-06-11 Thread Marko Rauhamaa
Antoon Pardon : > On 11-06-18 02:28, Steven D'Aprano wrote: >> The *whole point* of o.p.exists is to return False, not raise an >> exception. > > And the price is that it will not always give the correct answer. Yes, but that's still the point of the function's existence. Marko -- https://mail.

Re: Why exception from os.path.exists()?

2018-06-11 Thread Marko Rauhamaa
Barry Scott : > I think the rule is, if python can pass the string faithfully to the > OS, then do so, otherwise raise an exception that tells the programmer > that they are doing something that the OS does not allow for. Sure, but few application programmers would think of dealing with the surpri

Re: Why exception from os.path.exists()?

2018-06-11 Thread Barry Scott
> On 11 Jun 2018, at 01:03, Chris Angelico wrote: > > On Mon, Jun 11, 2018 at 9:52 AM, Steven D'Aprano > wrote: >> On Mon, 11 Jun 2018 06:10:26 +1000, Chris Angelico wrote: >> >>> Can you try creating "spam:ham" and "spam/ham"? If they're both legal, >>> I'd like to see what their file names

Re: Why exception from os.path.exists()?

2018-06-11 Thread Barry Scott
> On 11 Jun 2018, at 01:28, Steven D'Aprano > wrote: > > On Sun, 10 Jun 2018 22:09:39 +0100, Barry Scott wrote: > >> Singling out os.path.exists as a special case I do think is reasonable. >> All functions that take paths need to have a consistent response to data > > The *mere existence* o

Re: Posting warning message

2018-06-11 Thread Cameron Simpson
On 10Jun2018 23:38, Tamara Berger wrote: Thanks, everyone, for your suggestions. I didn't respond to your posts earlier because I wasn't notified by email updates. I don't understand why they've stopped coming. I didn't change any settings. Maybe we haven't been CCing you directly, just post

Re: Why exception from os.path.exists()?

2018-06-11 Thread Antoon Pardon
On 11-06-18 02:28, Steven D'Aprano wrote: > On Sun, 10 Jun 2018 22:09:39 +0100, Barry Scott wrote: > >> Singling out os.path.exists as a special case I do think is reasonable. >> All functions that take paths need to have a consistent response to data > The *mere existence* of os.path.exists means

Re: Stefan's headers [was:Names and identifiers]

2018-06-11 Thread Gregory Ewing
Chris Angelico wrote: You trimmed key parts of my post, I don't get this "You trimmed my post!11!" complaint that people make. Trimming a post when replying is the *right* thing to do. Just because someone doesn't quote a certain part of what you wrote, doesn't mean that they didn't read it

Re: Why exception from os.path.exists()?

2018-06-11 Thread Gregory Ewing
Steven D'Aprano wrote: The evidence suggests that using the Carbon APIs, NUL is just another Unicode character. Whatever API replaces Carbon, it will have to deal with file names created under Carbon, and classic Mac, and so likely will support the same. Thsi raises the interesting quesion of

Re: Why exception from os.path.exists()?

2018-06-11 Thread Gregory Ewing
Steven D'Aprano wrote: Besides, it is certainly not true that there are no OSes that can deal with NULs in file names. Classic Mac OS can, as filenames there are represented as Pascal strings (a length byte followed by an array of arbitrary bytes), not NUL-terminated C strings. There's even a