My son wants me to teach him Python

Jason Swails jason.swails at gmail.com
Fri Jun 14 02:28:29 EDT 2013


On Thu, Jun 13, 2013 at 11:33 PM, Rick Johnson <rantingrickjohnson at gmail.com
> wrote:

> On Thursday, June 13, 2013 3:18:57 PM UTC-5, Joshua Landau wrote:
>
> > [...]
> > GUI is boring. I don't give a damn about that. If I had it
> > my way, I'd never write any interfaces again (although
> > designing them is fine). Console interaction is faster to
> > do and it lets me do the stuff I *want* to do quicker.
>
> And are you willing to provide *proof* that the console is
> faster? Or is this merely just your "opinion"? I would be
> ready and willing to compete in a "Pepsi challenge" to
> disprove your claim if needed.  For instance, if i want to
> open a text file on my machine, i merely navigate to the
> file via my file browser interface, using clicks along the
> way, and then the final double click will open the text file
> using it's default program. Are you telling me you can type
> the address faster (much less remember the full path) than i
> can point and click? And if you think you're going to cheat
> by creating an "environment variable", well i can still win
> by doing the same thing with a "shortcut".
>

One of my favorite parts about the Mac over windows, actually, is that I
can open up a console.  Coupled with MacPorts or some other equivalent
package manager, I have what amounts to a working Linux environment
(almost).  The "open" command is particularly useful (equivalent to
double-clicking, with the ability to specify "-a <program name>" to invoke
a right-click->select program->[scan through program list]->click much more
easily.

Coupled with tab completion (as Chris mentioned), and a full history of
visited directories, I can navigate my file system in a console much faster
than I can navigate in the GUI.  It matters little to my productivity how
fast you can navigate a GUI.

But batch processing is, in general, much easier to do in the console in my
experience.  Two tasks I've wanted to do that were of general interest to
computer users (not specifically my work) that I wouldn't have bothered in
a GUI environment:

1) Autocrop a whole bunch of images (~100) to remove extraneous white space
around all of the edges. In the console with imagemagick:

bash$ for image in *.png; do convert $image -trim tmp.png; mv tmp.png
$image; done

2) Compress my library of 2000 jpegs, since I didn't need high-quality
jpegs AND raw images from my camera on my disk consuming space:

bash$ for image in `find . -name "*.jpg"`; do convert $image -quality 70
tmp.jpg; mv tmp.jpg $image; done

Using the console I was able to do both tasks in ~20 seconds quite easily.


> > Also - Python is pretty much the only language that
> > *isn't* overkill; once you take more than the first few
> > steps a language that's *consistent* will help more with
> > learning, a mon avis, than these "quicker" languages ever
> > will. Python is consistent and simple.
>
> Your statement is an oft cited misconception of the Python
> neophyte. I'm sorry to burst your bubble whilst also raining
> on your parade, but Python is NOT consistent. And the more i
> learn about Python the more i realize just how inconsistent
> the language is. Guido has the correct "base idea", however
> he allowed the evolution to become a train wreck.
>

You're right.  NameError's should not be listed with the full traceback
-- the last entry on the call stack is obviously the right way to treat
this special-case exception [1].  BTW, this comment amounts to
Contradiction. [2]

It's sometimes difficult to reconcile several of your comments...


> > [...]
> > Basically, "kid" is a *very* generic term and there are
> > people who like GUIs and there are people who like
> > internals
>
> Your statement is true however it ignores the elephant in
> the room. You can "prefer" console over GUI all day long but
> that does not negate the fact that GUI's outperform the
> console for many tasks. With the exception of text based
> games, the console is as useful for game programming as
> [something not useful]
>

Just because you click through a GUI faster does not mean that everyone
else does, too.

And I've developed some Tkinter-based apps (that you can even download if
you were so interested)---I did all the development on the command-line
using vim and git.

All the best,
Jason

[1] http://mail.python.org/pipermail/python-list/2013-March/642963.html
[2]
https://upload.wikimedia.org/wikipedia/commons/a/a7/Graham%27s_Hierarchy_of_Disagreement1.svg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130614/55794e66/attachment.html>


More information about the Python-list mailing list