[Tutor] Dumb question on emacs and python ...

hcohen2 hcohen2 at comcast.net
Sat Dec 27 18:22:24 EST 2003


Danny Yoo wrote:

>>>>That's what I thought too, but (repeated it again) openning the file
>>>>without the '*' yields an empty file.  It looks crazy to me too.
>>>>
>>>>I guess I am just going to write the file by pasting lines, or typing
>>>>it in new.  The change in appearance and the failure to execute are
>>>>too strong hints to ignore.
>>>>        
>>>>
>
>Hello!
>
>Ok, I think we're flailing about a bit too much here.  *grin* Let's make
>sure we all understand what the problem is.
>
>Can you show us what happens if you type:
>
>###
>$ ls -l fgrepwc_allcnt.py
>###
>
>at your command line prompt?  And what happens if you type:
>
>###
>$ ls -l fgrepwc_allcnt.py*
>###
>
>Are the outputs of these two shell commands different?  Once we see those
>outputs, we'll be more sure if the file name has anything to do with the
>problem.
>
>
>Emacs, by default, may not support Python out of the box!  You may
>actually need to install 'python-mode' to let your Emacs text editor to
>recognize Python's syntax.  We can find instructions on enabling
>python-mode here:
>
>    http://www.python.org/cgi-bin/moinmoin/EmacsEditor
>
>There can be several possiblities why Emacs isn't treating your source
>file nicely.  Let's eliminate each possibility first.  We can first check
>to see if python-mode actually works in emacs:  can you actually go into
>python-mode from the '*scratch*' emacs buffer?  What happens if you do a
>'M-x python-mode' from emacs?  Do you see a change in the status line?
>Or do you get an error message?
>
>
>Installation problems are always a bit tricky and frustrating, because the
>cause of the problem is probably something really stupid.  *grin* Let's
>see if we can fix this one quickly so you can start doing more interesting
>things.
>
>Good luck to you!
>
>
>  
>
Dan,

Where were you before I went to dinner?  ;-)

Did not bother to check, upon my return - played with my code a bit more 
and it is running and counting multiple instances of match text strings 
along the same line.  Ugly code, however.

I have another problem if you are willing to humor me: tell me about 
getopt and how this can be used to see lower or mixed case matches.  I 
am confused by the documentation I found through the python.org site.  
It seems to imply that the gnu getopt is unlike the one in UNIX and may 
not work in the same manner.  Moreover, I cannot see how any of the 
options are of any use to me for this problem.

I was right about the lack of color coding of the code was significant, 
though I have no idea how the simple cp command so altered the file.

Thanks,
Herschel





More information about the Tutor mailing list