IDLE Default Working Directory

2018-11-12 Thread Christman, Roger Graydon
Could anyone tell me how to set up IDLE's default working directory, so that it would be in the same place for each startup? (Like C:\Users\myname\Python) I teach a course that mounts a lot of file space across the network and the default directory for all my students is a readonly directory,

Re: IDLE Default Working Directory

2018-11-13 Thread Christman, Roger Graydon
On 13 Nov 2018, at 09:51, Bev in TX wrote: > On Nov 12, 2018, at 5:50 PM, Terry Reedy wrote: > > For me, open (command-O) opens 'Documents'. I presume it should be easy > enough to move into a 'py' subfolder. The whole point is for Idle -> File -> Open (or

Re: IDLE Default Working Directory

2018-11-12 Thread Christman, Roger Graydon
eryk sun responded: On 11/12/18, Christman, Roger Graydon wrote: > > I looked in IDLE's own configuration menu, and didn't see anything there -- > and I fear that I might have to fight some Windows settings somewhere else > instead. I think this i

Re: Loop with Else Clause

2019-02-05 Thread Christman, Roger Graydon
-Original Message- From: Python-list On Behalf Of DL Neil Sent: Monday, February 4, 2019 11:29 PM To: 'Python' Subject: Loop with else clause What is the pythonic way to handle the situation where if a condition exists the loop should be executed, but if it does not something else

Re: encapsulating a global variable (BlindAnagram)

2020-02-25 Thread Christman, Roger Graydon
> On Tue, 25 Feb 2020 3:06 PM BlindAnagram wrote: > My interest in this stems from wanting to keep the dictionary only > available to the function that uses it and also a worry about being > called from threaded code. It seems like the simplest solution for this is to make a completely new file

Re: Friday Finking: Poly more thick

2020-02-29 Thread Christman, Roger Graydon
Emending my own note from moments ago: def any_as_dict(*args, **kwargs): if len(args) == 0: my_dict = kwargs elif type(args[0]) == type(dict()): my_dict = args[0] else: my_dict = dict(args[0]) print(type(my_dict),my_dict) >>> any_as_dict(a=1,b=2) {'a': 1, 'b': 2} >>> any_as_dict({'a':1,

Re: Friday Finking: Poly more thick

2020-02-29 Thread Christman, Roger Graydon
DL Neil asked: > How does one code a function/method signature so that > it will accept either a set of key-value pairs, > or the same data enclosed as a dict, as part of > a general-case and polymorphic solution? Will this do for you? def any_as_dict(*args, **kwargs): if len(args) == 0:

Re: new feature in Python

2020-09-30 Thread Christman, Roger Graydon
On 30/09/2020, yonatan <53770...@gmail.com> proposed: > instead of > con = "some text here" > con = con.replace("here", "there") > we could do > con = "some text here" > con .= replace("here", "there") That would require a major rewrite of the grammer of the Python language, which would

Re: Friday Finking: Limiting parameters

2020-07-11 Thread Christman, Roger Graydon
I'll preface this by saying I am a programming instructor who still teaches from the ivory tower, so may not necessarily reflect actual practice in industry. But I have a very simple rule of thumb for limiting parameters: One should be able to summarize what a function does in one or two

Re: New assignmens ...

2021-10-27 Thread Christman, Roger Graydon
On 27/10/2021 at 12:45 Antoon Pardon wrote: > However with the introduction of the walrus operator there is a > way to simulate a significant number of one and a half loops. > Consider the following: >do > a = expr1 > b = expr2 > while 2 * a > b: > more calculations

Re: New assignmens ...

2021-10-27 Thread Christman, Roger Graydon
On 27/10/2021 8:28, Anton Pardon wrote: >>> Suppose I would like to write a loop as follows: >>. >while ((a, b) := next_couple(a, b))[1]: >> >do needed calculations >> >> >>> What I can do is write it as follows: >>> while [tmp := next_couple(a,b), a := tmp[0], b :=

Re: New assignmens ...

2021-10-25 Thread Christman, Roger Graydon
Message: 8 Date: Mon, 25 Oct 2021 11:20:52 +0200 From: Antoon Pardon To: python-list@python.org Subject: Re: New assignmens ... Message-ID: <5761dd65-4e87-8b8c-1400-edb821204...@vub.be> Content-Type: text/plain; charset=utf-8; format=flowed On 25/10/2021 11:20, Anton Pardon wrote: > Suppose I

Re: memoization (original Subject lost because mailer lost the whole thread)

2022-09-19 Thread Christman, Roger Graydon
"Hen Hanna" asked: > so... for a few days i've been revising this Code (in Gauche / Lisp / > Scheme) to make it run faster.. and last night i could improve it enough > to give me the result i wantedin 72 minutes or so (on my slow PC at > home). > ( Maybe... within a few months,

Re: Python-list Digest, Vol 232, Issue 1

2023-01-01 Thread Christman, Roger Graydon
Re: Nonetype List In my introductory programming course, I have drawn some attention to this behavior regarding mutating lists. Indeed, Python is very consistent with its behavior: Any function that mutates a list parameter does not return that list as a return value. For one thing, there