Extract lines from file, add to new files

avi.e.gross at gmail.com avi.e.gross at gmail.com
Sat Feb 3 19:20:18 EST 2024


Dave,

You and I have had some experience in teaching or tutoring others and I think it fair to say our motivation is closer to teaching someone how they can fish for themselves rather than just handing them a fully-cooked fish.

My favorite kinds of questions, thus, include someone who explains what they are trying to do and shows some code along with indications of what it produced (including error messages) and what it should produce. Then the question should not be a request to just FIX THIS or WRITE IT FOR ME but asking if someone can show what they did wrong with some idea where it went wrong.

This may not be so common but it allows faster and easier help.

But others out there probably can be helped including people who want suggestions of approaches to try.

We have discussed some issues here and elsewhere where some purists tend to want to stick with close to basic aspects of the language. In some R communities, some get upset if someone asks a question (or others supply an answer) using non-official add-ons called the tidyverse and I suspect some here don't really like discussions that focus mainly on numpy/pandas or so many other modules. Yet, the reality is, that except for students who are supposed to be learning the basics of the language and show solutions compatible with what is being taught in class, others can and should be open to simple solutions using non-standard tools that are widely available and vetted. If a student is asked to use some method to calculate a value like pi, then suggesting they use math.pi is not useful. But if the assignment is to do something in trigonometry, it seems a good thing to use as a part of a larger solution rather than either embedding a constant to N decimal places or calculating it on the fly.

I think people like us who volunteer to reply should consider our choices too. I think it is fair to reply, as I saw on the tutor forum, that the code shown uses a method that is not the way the replier would do it but nonetheless offer some thoughts on particular python coding errors. I am talking about someone who wanted to implement a binary tree using a numpy array or something with minimal explanation and demanded a fix. They never supplied enough info and I think the few who replied backed away. As you mention, they seemed resistant to starting over and using data structures that are perhaps more amenable, and in any case, the code shown seemed mostly focused on how to make random and non-redundant names. 

I will end with a comment. I have heard of interview techniques for a job where they deliberately supply a problem in which the goal is not so much to be easy to solve in front of them in real time but to watch how the person looking for a job responds to the uncertainties and asks follow-up questions or verbalizes things like, if it is like this, I might use this technique but if you also need that then ...

So, I shudder to think what happens if someone being interviewed turns around and asks us and further confuses things with changes to make it harder to recognize they are asking for outside help. The answer expected may well be to NOT use say the older versions of PASCAL to do something but switch to something better suited (and for that matter available.)  I would not want to program the DES encryption/decryption method in Pascal again! And these days, it seems much better to just find a module or package that meets such needs.

Avi



-----Original Message-----
From: Python-list <python-list-bounces+avi.e.gross=gmail.com at python.org> On Behalf Of dn via Python-list
Sent: Saturday, February 3, 2024 5:02 PM
To: python-list at python.org
Subject: Re: Extract lines from file, add to new files

Every trainer, in any field, has to deal with these problems - all the 
time, and over-and-over.


On 4/02/24 06:58, Thomas Passin via Python-list wrote:
> In my view this whole thread became murky and complicated because the OP 
> did not write down the requirements for the program.  Requirements are 
> needed to communicate with other people.  An individual may not need to 
> actually write down the requirements - depending on their complexity - 
> but they always exist even if only vaguely in a person's mind.  The 
> requirements may include what tools or languages the person wants to use 
> and why.
> 
> If you are asking for help, you need to communicate the requirements to 
> the people you are asking for help from.
> 
> The OP may have thought the original post(s) contained enough of the 
> requirements but as we know by now, they didn't.

There is another possible interpretation in such situations (not 
necessarily this one): that the person is fixated on a particular 
solution (and unable/unwilling to adjust his/her thinking to consider 
more widely).

Thus, the question is not: 'here's an entire problem, how can it be 
solved', but more: 'I have a solution, and want help to implement it 
(and only it) just-so'.


The latter is an interesting psychology:

1
an experienced person who is trying to translate from one tool to 
another (Python), but discovers that a word-for-word solution is 
difficult because of the artificial-constraints they've placed on the 
situation.

2
a beginner who doesn't know what (s)he doesn't know and comes-up with an 
idea, but fails to appreciate that there is likely more than one path to 
the goal.


> The person asking for help may not realize they don't know enough to 
> write down all the requirements; an effort to do so may bring that lack 
> to visibility.

In the case of 'Beginners' this should probably be taken-as-read!

Which is why we will always find ourselves asking questions or 'please 
give more information'...


However, there are other reasons, eg corporate concerns or personality; 
why people don't want to give more information. The former is reasonable 
(have suffered from same myself). The latter may reveal that the person 
is 'difficult to deal with'...


> Mailing lists like these have a drawback that it's hard to impossible 
> for someone not involved in a thread to learn anything general from it. 
> We can write over and over again to please state clearly what you want 
> to do and where the sticking points are, but newcomers post new 
> questions without ever reading these pleas.  Then good-hearted people 
> who want to be helpful end up spending a lot of time trying to guess 
> what is actually being asked for, and maybe never find out with enough 
> clarity.  Others take a guess and then spend time working up a solution 
> that may or may not be on target.
> 
> So please! before posting a request for help, write down the 
> requirements as best you can figure them out, and then make sure that 
> they are expressed such that the readers can understand.

Unfortunately, if the person doesn't understand the problem (leave-aside 
any ideas of solution), then (s)he will not be able to clearly 
communicate same to us, in any way, shape, or form...

Which brings one to the question: if a person cannot express the problem 
clearly and completely, is (s)he suited to development work? If the 
problem is not understood, could 'the solution' ever be more than an 
exercise in hope?
(prototyping and experimentation aside)


Yes, it is frustrating to invest time and effort in helping someone, 
only for same to disappear 'into a black hole'. The lack of response 
seems to indicate a lack of respect or appreciation. Is this perhaps 
part of today's "consumer" life-style, where so few are contributors or 
creators?


On the other side of that coin: do the people who make assumptions and 
(kindly) blaze-ahead with 'a solution', actually help the conversation? 
If the assumptions are correct, yes! What if they are not?


...and don't get me started on folk who want us to do their 
training-assignments or build some application, for them!


As a slight aside: on one training-course DiscussionList/BulletinBoard 
set-up, if a trainee asked a question without a descriptive 
title/SubjectLine, eg "Python not working" or "Urgent: please help"; I 
asked them to re-post with a title that would help others in a similar 
situation find the topic - and closed the original thread.

Some found it "brutal" - probably skewing towards those who felt 
"Urgent" because they'd left things too close to deadline. Others joined 
the (later) thread because they could identify the topic and realise 
their interest in learning or contributing to the conversation...


Time pressures lead to a multitude of evils!


There's a quotation that goes something like "the poor will be with your 
always"?
(?possibly Biblical)

Whether we (here) are talking about 'poor' manners, 'poor' 
understanding, 'poor' communication skills, 'poor' Python knowledge, or 
whatever; isn't such one of the rationales for this DiscussionList?

That said, we're all volunteering our (valuable) time!
-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list