Re: [Tutor] The results of your email commands

2017-08-02 Thread Alan Gauld
I'[ve CCd the list, please use ReplyAll when responding to the list. On 02/08/17 22:13, Borisco Bizaro wrote: > Hi,am try to write a code that take input from user continuently > until key press it stop and give total amount user enter. > while True: > input ("enter another

[Tutor] Loop problem (was: Re: Tutor Digest, Vol 161, Issue 42)

2017-08-02 Thread Alan Gauld via Tutor
On 02/08/17 20:53, Borisco Bizaro wrote: > I try this using loop but could not stop by pressing a key and could not > give total price please help me It would help if you showed us the code you wrote with the loop. Its difficult to guess what you did wrong when we can't see it. > print"\n

Re: [Tutor] if __name__=='main' vs entry points: What to teach new comers?

2017-08-02 Thread eryk sun
On Wed, Aug 2, 2017 at 4:06 PM, Wolfgang Maier wrote: > On 08/02/2017 04:57 PM, Steven D'Aprano wrote: > >> I have a module with a main() function and an "if __name__ == ..." >> guard. Under what circumstances is that not sufficient, and I would want >>

Re: [Tutor] If tuple cannot be sorted, then why sorted() on a tuple is fine?

2017-08-02 Thread Alan Gauld via Tutor
On 02/08/17 20:01, C W wrote: > I am a little confused about why Tuple can be sorted. > > Suppose I have the following, > >> aTuple = (9, 3, 7, 5) >> sorted(aTuple) > [3, 5, 7, 9] sorted() returns a new object. The original tuple has not been changed - print aTuple to confirm this. HTH --

Re: [Tutor] Tutor Digest, Vol 161, Issue 42

2017-08-02 Thread Borisco Bizaro
I try this using loop but could not stop by pressing a key and could not give total price please help me On Jul 31, 2017 13:07, boriscobiza...@gmail.com wrote: print"\n welcome to progrom that print total price\n" a=int(input("enter the first price: ")) b=int(input ("enter another price: "))

Re: [Tutor] If tuple cannot be sorted, then why sorted() on a tuple is fine?

2017-08-02 Thread Mats Wichmann
it generated a new object, did not change the original. hint: notice the output is a list, not a tuple! On August 2, 2017 1:01:31 PM MDT, C W wrote: >Dear list, > >I am a little confused about why Tuple can be sorted. > >Suppose I have the following, > >> aTuple = (9, 3, 7,

[Tutor] If tuple cannot be sorted, then why sorted() on a tuple is fine?

2017-08-02 Thread C W
Dear list, I am a little confused about why Tuple can be sorted. Suppose I have the following, > aTuple = (9, 3, 7, 5) > sorted(aTuple) [3, 5, 7, 9] Why is it ok to sort a the class tuple? If it is invariant by nature, then wouldn't applying a function on it yield an error? Thanks!

Re: [Tutor] if __name__=='main' vs entry points: What to teach new comers?

2017-08-02 Thread Wolfgang Maier
On 08/02/2017 04:57 PM, Steven D'Aprano wrote: On Wed, Aug 02, 2017 at 10:48:39PM +1000, Ben Finney wrote: Thomas Güttler writes: Maybe I am doing something wrong. I was proud because I did use “console_scripts” entry points. Did someone lead you to believe

Re: [Tutor] if __name__=='main' vs entry points: What to teach new comers?

2017-08-02 Thread Steven D'Aprano
On Wed, Aug 02, 2017 at 10:48:39PM +1000, Ben Finney wrote: > Thomas Güttler writes: > > > Maybe I am doing something wrong. I was proud because I did use > > “console_scripts” entry points. > > Did someone lead you to believe it was wrong? Setuptools

Re: [Tutor] if __name__=='main' vs entry points: What to teach new comers?

2017-08-02 Thread Ben Finney
Thomas Güttler writes: > Maybe I am doing something wrong. I was proud because I did use > “console_scripts” entry points. Did someone lead you to believe it was wrong? Setuptools console_scripts entry points are a good tool. My point was that it is an *advanced*

Re: [Tutor] What is meaning of "/" in "pow(x, y, z=None, /)"?

2017-08-02 Thread boB Stepp
On Wed, Aug 2, 2017 at 1:59 AM, eryk sun wrote: > On Wed, Aug 2, 2017 at 1:06 AM, boB Stepp wrote: >> A quick scan of some of my Python books does not turn up the use of >> "/" as a function argument. I have a nagging feeling I've read about >> this

Re: [Tutor] What is meaning of "/" in "pow(x, y, z=None, /)"?

2017-08-02 Thread Mats Wichmann
On 08/01/2017 07:14 PM, Ben Finney wrote: > boB Stepp writes: > >> A quick scan of some of my Python books does not turn up the use of >> "/" as a function argument. > > The appearance of this in Python's documentation and dfunction signature > descriptions, without a

Re: [Tutor] if __name__=='main' vs entry points: What to teach new comers?

2017-08-02 Thread Thomas Güttler
Am 02.08.2017 um 05:51 schrieb Steven D'Aprano: On Wed, Aug 02, 2017 at 11:22:00AM +1000, Ben Finney wrote: Steven D'Aprano writes: On Tue, Aug 01, 2017 at 04:54:40PM +0200, Thomas Güttler wrote: [...] I use Python since several years and I use console_script in

Re: [Tutor] if __name__=='main' vs entry points: What to teach new comers?

2017-08-02 Thread Thomas Güttler
Am 02.08.2017 um 05:35 schrieb Abdur-Rahmaan Janhangeer: what difference do you make between python scripts and python code files? are codes relating to file manipulation called scripts? Do you ask this question all people on this list, or only one particular person? I don't know the

[Tutor] __main__.py file Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-02 Thread Thomas Güttler
Do both. If you’re making a package, create a __main__.py file as well so your package is usable with `python -m somepackage`. On the other hand, if you’re making things more akin to shell scripts, using just entry_points makes stuff harder, because you need to install the code (and write a

Re: [Tutor] if __name__=='main' vs entry points: What to teach new comers?

2017-08-02 Thread Alan Gauld via Tutor
On 02/08/17 04:35, Abdur-Rahmaan Janhangeer wrote: > what difference do you make between python scripts and python code files? > Not much. Scripts are a concept more than a defined term, they often refer to executable programs written in a "scripting language" - which is usually an interpreted

Re: [Tutor] Python Daemons

2017-08-02 Thread dbosah
Also here's the link to the tutorial https://youtu.be/WrtebUkUssc Original message From: Steven D'Aprano Date: 8/1/17 8:49 PM (GMT-05:00) To: tutor@python.org Subject: Re: [Tutor] Python Daemons Hi Daniel, My responses below. On Tue, Aug 01, 2017 at

Re: [Tutor] if __name__=='main' vs entry points: What to teach new comers?

2017-08-02 Thread Abdur-Rahmaan Janhangeer
what difference do you make between python scripts and python code files? are codes relating to file manipulation called scripts? Abdur-Rahmaan Janhangeer, Mauritius abdurrahmaanjanhangeer.wordpress.com On 1 Aug 2017 22:48, "Alan Gauld via Tutor" wrote: > On 01/08/17 15:54,

Re: [Tutor] Python Daemons

2017-08-02 Thread Cameron Simpson
On 01Aug2017 14:48, Daniel Bosah wrote: I'm following an online tutorial about threading. This is the code I've used so far: In addition to the other replies, which mention the general computing "daemon" notion and the "python-daemon" library which aids making such python

Re: [Tutor] What is meaning of "/" in "pow(x, y, z=None, /)"?

2017-08-02 Thread eryk sun
On Wed, Aug 2, 2017 at 1:06 AM, boB Stepp wrote: > I had typed help(pow) in the interpreter and got: > > > py3: help(pow) > Help on built-in function pow in module builtins: > > pow(x, y, z=None, /) > Equivalent to x**y (with two arguments) or x**y % z (with three