osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

program that search string in text file and do something


Grant Edwards wrote:
> Peter Otten <__peter__ at web.de> wrote:
> 
> > What we won't do is write a program for you ready to
> > present to your teacher.
> 
> Or if we do, it will be subtly sabotaged in a manner that
> will make it obvious to an experienced Python programmer
> that you didn't write it.  My favorite is to use some
> combination of particularly obscure and obtuse mechanisms
> that will actually product the correct results but do so in
> a way that nobody (including myself a few days later) will
> be able to explain without some intense study.

I would caution the OP against blindly soliciting for free
homework answers on the internet, most especially when the
request includes the deletion of files. Perhaps in this
forum the worst case scenario would be the return of a
scornful rebuke or a heavily obfuscated chunk of abysmal
code. However, in some of the darker, more devious corners
of the web, a naive solicitation such as this could end with
the student's file-system suddenly being relieved of the
burden of carrying around all those extra files. A most
unforgiving lesson in the power and conciseness of the
recursive algorithm.