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

2017-08-03 Thread C W
As pointed out by someone else, ?sorted sorted(iterable, key=None, reverse=False) It seems like the only requirement is iterable. I guess tuple is iterable, so, it doesn't break the assumption that tuple is immutable. That's what I see, am I right in that? Thanks! On Wed, Aug 2, 2017 at 4:07 PM

Re: [Tutor] The results of your email commands

2017-08-03 Thread Abdur-Rahmaan Janhangeer
me i cooked up : [warning : see code above better but i did it a bit differently] x = True sum = 0 while (x==True): a = input("input:") if a =="exit": x=False try: sum += float(a) except: pass print("sum :",sum) On Thu, Aug 3, 2017 at 3:09 AM, Alan Gauld

[Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-03 Thread Thomas Güttler
Am 02.08.2017 um 18:06 schrieb 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 le

[Tutor] file move with wait period

2017-08-03 Thread banda gunda
Dear tutors, I am interested to move a set of files, periodically, from source_folder to dest_folder. source_folder receives processed files from a ‘decompressing program’. The files are deposited from the ‘decompressing program’ at periodic random intervals. Furthermore some of the files dro

Re: [Tutor] The results of your email commands

2017-08-03 Thread Alan Gauld via Tutor
On 03/08/17 11:05, Abdur-Rahmaan Janhangeer wrote: > me i cooked up :... Yes that works too, especially if you don;t need access to the individual prices later. There are a couple of things to make it more Pythonic... > x = True > sum = 0 > > while (x==True): > a = input("input:") > if

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-03 Thread Chris Warrick
On 3 August 2017 at 09:52, Thomas Güttler wrote: > > > Am 02.08.2017 um 18:06 schrieb 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 wro

Re: [Tutor] The results of your email commands

2017-08-03 Thread Mats Wichmann
On 08/03/2017 10:21 AM, Alan Gauld via Tutor wrote: > On 03/08/17 11:05, Abdur-Rahmaan Janhangeer wrote: >> me i cooked up :... > > Yes that works too, especially if you don;t need access > to the individual prices later. > > There are a couple of things to make it more Pythonic... > >> x = True

Re: [Tutor] basic decorator question

2017-08-03 Thread Steven D'Aprano
Sorry for the delay in responding to this thread! On Wed, Jul 26, 2017 at 09:22:59PM -0500, boB Stepp wrote: > I am having a recurring problem with Python: I can work out the > mechanics of how various Python constructs work, such as decorators, > but then I find myself scratching my head as to

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-03 Thread Ben Finney
Thomas Güttler writes: > Why are there two ways: "script" vs "console_scripts entry-point"? Because Distutils implements only ‘scripts’, and that's not capable enough for what people need so Setuptools implements entry points. In other words: One of them is in the standard library and does some

[Tutor] (no subject)

2017-08-03 Thread Howard Lawrence
hi ! i am newbie to coding love it but need help with problems which i searched but poor results this is the error: typeError unorderable types: int()https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] file move with wait period

2017-08-03 Thread Cameron Simpson
On 03Aug2017 11:22, banda gunda wrote: Dear tutors, I am interested to move a set of files, periodically, from source_folder to dest_folder. source_folder receives processed files from a ‘decompressing program’. The files are deposited from the ‘decompressing program’ at periodic random int

Re: [Tutor] (no subject)

2017-08-03 Thread boB Stepp
Greetings Howard! On Thu, Aug 3, 2017 at 3:27 PM, Howard Lawrence <1019sh...@gmail.com> wrote: > hi ! i am newbie to coding love it but need help with problems which i > searched but poor results this is the error: typeError unorderable types: > int() the code in short, number=random.randint(1,20)

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-03 Thread eryk sun
On Thu, Aug 3, 2017 at 4:22 PM, Chris Warrick wrote: > > Simple: `scripts` are legacy. `entry_points` are the new thing. > There’s also a third approach: gui_scripts entry_points, which work > the same way on Linux/*nix, but on Windows, it means that running your > script by opening the created .e

Re: [Tutor] file move with wait period

2017-08-03 Thread Mats Wichmann
On 08/03/2017 05:22 AM, banda gunda wrote: > Dear tutors, > > I am interested to move a set of files, periodically, from source_folder to > dest_folder. > source_folder receives processed files from a ‘decompressing program’. The > files are deposited from the ‘decompressing program’ at periodi

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

2017-08-03 Thread Cameron Simpson
On 03Aug2017 00:57, Steven D'Aprano wrote: Can you explain the use-case for when somebody might want to use console_scripts entry points? I have a module with a main() function and an "if __name__ == ..." guard. Under what circumstances is that not sufficient, and I would want console_scripts?

Re: [Tutor] (no subject)

2017-08-03 Thread Cameron Simpson
Hi, and welcome to the tutor list. Please try to provide a useful subject line in future posts (not "help", perhaps something like "I don't understand this TypeError message"). Anyway, to your question: On 03Aug2017 13:27, Howard Lawrence <1019sh...@gmail.com> wrote: hi ! i am newbie to codi