On Thu 21 May 2026 at 10:00:19 (-0400), Kevin Cole wrote:
> On Wed, May 20, 2026 at 9:21 PM Lucas Pinke <[email protected]> wrote:
> > On a lark, I tried it. The cursor changes to a cross that I've never seen 
> > before. Then, typing anything results in:
> > 
> >     $ ./Morse2Lily.py
> >     ./Morse2Lily.py: line 3: dicLily: command not found
> >     ./Morse2Lily.py: line 4: c:: command not found
> >     ./Morse2Lily.py: line 5: L:: command not found
> >     ./Morse2Lily.py: line 6: P:: command not found
> >     ./Morse2Lily.py: line 7: F:: command not found
> >     ./Morse2Lily.py: line 8: syntax error near unexpected token `}'
> >     ./Morse2Lily.py: line 8: `    }'
> > 
> > 
> > It also creates a PostScript file named "re" which contains a screenshot of 
> > the terminal window in which Morse2Lily.py is being run. Apparently that's 
> > what the cross cursor is doing: Indicating that a screenshot is about to be 
> > taken... I think. I may give it a closer look to see what's wrong. 

The first lines of the script are:

  import re

  dicLily = {
      "c": "c", ".": "16_\".\"", "-": "8._\"_\"",
  … … …

so you ran imagemagick's import command:

   import  - saves any visible window on an X server and outputs it as
   an image file. You can capture a single window, the entire screen,
   or any rectangular portion of the screen. 

and then tried to run a dicLily command, etc.

(On my system, even the import command fails because of my security
setting in /etc/ImageMagick-6/policy.xml.)

> > I'll add instructions to the GH page...
> > You must run it through python (i.e python3 ./Morse2Lily.py).
> > I wrote it that way because I thought the shebang would mess up using it on 
> > windows.

As # is the comment character in python, it won't mess up the script.

> Doubtful: Wouldn't Windows just see a comment that starts with an
> exclamation point?

Yes, if they just run it as they might run any python script. (Most
scripts contain lots of comments.)

Whether it would function as a shebang in windows would depend on
what's written after the shebang, and which version of which program
they tried to run it under. But that's up to the individual user and
their system.

You can add the shebang yourself, of course. While you're at it,
you might as well modify:
  import re, sys
and also:
  print("Type in your sentence:", file=sys.stderr)
so that you can redirect the output to a file without losing the
input prompt.

Cheers,
David.

Reply via email to