Re: [Tutor] Please look at my wordFrequency.py

2005-10-12 Thread Dick Moores
Alan Gauld wrote at 10:04 10/12/2005: > > The regex HOWTO, above, mentions, in section 3.3, a tool that comes with > > Python 2.4 for practicing/testing regex. Tools/scripts/redemo.py . > Can you > > recommend this? And how about Kodos? () > >Yes I can recommend it,

Re: [Tutor] Please look at my wordFrequency.py

2005-10-12 Thread Alan Gauld
> The regex HOWTO, above, mentions, in section 3.3, a tool that comes with > Python 2.4 for practicing/testing regex. Tools/scripts/redemo.py . Can you > recommend this? And how about Kodos? () Yes I can recommend it, its a great tool for trying REs out Alan G.

Re: [Tutor] Please look at my wordFrequency.py

2005-10-12 Thread Kent Johnson
Dick Moores wrote: > The regex HOWTO, above, mentions, in section 3.3, a tool that comes with > Python 2.4 for practicing/testing regex. Tools/scripts/redemo.py . Can > you recommend this? And how about Kodos? () Yes, it's very handy. Try it! Kodos is similar. I th

Re: [Tutor] Please look at my wordFrequency.py

2005-10-12 Thread Dick Moores
Alan Gauld wrote at 06:00 10/12/2005: > > See Also:Mastering Regular Expressions Book on regular expressions by > > Jeffrey Friedl, published by O'Reilly. The second edition of the book no > > longer covers Python at all, but the first edition covered writing good > > regular expression patterns in

Re: [Tutor] Please look at my wordFrequency.py

2005-10-12 Thread Alan Gauld
> See Also:Mastering Regular Expressions Book on regular expressions by > Jeffrey Friedl, published by O'Reilly. The second edition of the book no > longer covers Python at all, but the first edition covered writing good > regular expression patterns in great detail. " > > So I'd like to ask if

Re: [Tutor] Please look at my wordFrequency.py

2005-10-12 Thread Dick Moores
John Fouhy wrote at 15:09 10/11/2005: >On 12/10/05, Dick Moores <[EMAIL PROTECTED]> wrote: > >Hi Dick, > >Glad you're making progress :-) > > > Yes, that's about the difference I was seeing. Thanks for taking the > > trouble. I went from 30 to 27. With no regex use (don't understand it > yet). > >

Re: [Tutor] Please look at my wordFrequency.py

2005-10-11 Thread Kent Johnson
Andrew P wrote: > Just want to add a little something here, because reading over this > thread, I think there may have been some confusion: > > Kent wrote: > > for e in saveRemovedForLaterL: >L.append(e) > could be > L.extend(e) > > I think he might have meant: > > for e in saveRemovedForL

Re: [Tutor] Please look at my wordFrequency.py

2005-10-11 Thread Andrew P
Just want to add a little something here, because reading over this thread, I think there may have been some confusion: Kent wrote: for e in saveRemovedForLaterL:    L.append(e)could be L.extend(e) I think he might have meant: for e in saveRemovedForLaterL:    L.append(e)could be L.extend(sav

Re: [Tutor] Please look at my wordFrequency.py

2005-10-11 Thread Kent Johnson
Dick Moores wrote: > Kent Johnson wrote at 10:37 10/11/2005: >>The reason psyco doesn't make much difference is because all the time is >>spent in list.count() which is already C code. > > > Ah. But how can I know what is in C code and what isn't? For example, in > a previous post you say that

Re: [Tutor] Please look at my wordFrequency.py

2005-10-11 Thread Dick Moores
Kent Johnson wrote at 10:37 10/11/2005: >Kent Johnson wrote: > > Dick Moores wrote: > > > >> Kent Johnson wrote at 03:24 10/11/2005: > >> > >>> Dick Moores wrote: > >>> > (Execution took about 30 sec. with my computer.) > >>> > >>> > >>> That's way too long > >> > >> > >> > >> How long would y

Re: [Tutor] Please look at my wordFrequency.py

2005-10-11 Thread Kent Johnson
Kent Johnson wrote: > Dick Moores wrote: > >> Kent Johnson wrote at 03:24 10/11/2005: >> >>> Dick Moores wrote: >>> (Execution took about 30 sec. with my computer.) >>> >>> >>> That's way too long >> >> >> >> How long would you expect? I've already made some changes but haven't >> seen the t

Re: [Tutor] Please look at my wordFrequency.py

2005-10-11 Thread Kent Johnson
Dick Moores wrote: > Kent Johnson wrote at 03:24 10/11/2005: > >>Dick Moores wrote: >> >>>(Execution took about 30 sec. with my computer.) >> >>That's way too long > > > How long would you expect? I've already made some changes but haven't > seen the time change much. A couple of seconds at mo

Re: [Tutor] Please look at my wordFrequency.py

2005-10-11 Thread Dick Moores
Kent Johnson wrote at 03:24 10/11/2005: >Dick Moores wrote: > > (Execution took about 30 sec. with my computer.) > >That's way too long How long would you expect? I've already made some changes but haven't seen the time change much. > > > > Specifically, I'm hoping for comments on or help with:

Re: [Tutor] Please look at my wordFrequency.py

2005-10-11 Thread Kent Johnson
Dick Moores wrote: > (Execution took about 30 sec. with my computer.) That's way too long > > Specifically, I'm hoping for comments on or help with: > 2) I've tried to put in remarks that will help most anyone to understand > what the code is doing. Have I succeeded? Yes, i think so > 3) No mo

[Tutor] Please look at my wordFrequency.py (Alan Darwish)

2005-10-11 Thread iPlanetLDAP
Exceptional Python Ladies and Gents How about to make this great wordFrequency.py script to support Unicode/Locale wordFrequency.py for example this is an Arabic code page 1256 windows I guess it is a matter of character encoding. Try execute the following command before running wordFrequency.py

Re: [Tutor] Please look at my wordFrequency.py

2005-10-11 Thread Dick Moores
Danny Yoo wrote at 15:47 10/10/2005: > > 3) No modularization. Couldn't see a reason to do so. Is there one or > > two? Specifically, what sections should become modules, if any? > > >Hi Dick, > >My recommendation is to practice using and writing functions. I certainly will, Danny. You've convinc

Re: [Tutor] Please look at my wordFrequency.py

2005-10-11 Thread Dick Moores
Kent Johnson wrote at 15:25 10/10/2005: >Dick Moores wrote: > > Specifically, I'm hoping for comments on or help with: > > 1) How to debug. I'm using v2.4, IDLE on Win XP. > >I have been using winpdb recently, it is a pretty decent standalone >Python debugger for Windows. Start it with the -t swi

Re: [Tutor] Please look at my wordFrequency.py

2005-10-11 Thread Dick Moores
John Fouhy wrote at 14:47 10/10/2005: >Some comments: > > >textAsString = input.read() > >S = "" >for c in textAsString: > if c == "\n": > S += ' ' > else: > S += c > > >You could write this more concisely as: > >S = textAsString.replace('\n', ' ') Yes! Thanks. Tha

Re: [Tutor] Please look at my wordFrequency.py

2005-10-11 Thread Dick Moores
Thank you, Andrew, for your wise and thoughtful comments. Andrew P wrote at 23:58 10/10/2005: >If it makes you feel any better, this isn't an easy problem to get 100% >right, traditionally. Heck, it might not even be possible. A series of >compromises might be the best you can hope for. Yes,

Re: [Tutor] Please look at my wordFrequency.py

2005-10-11 Thread Alan Gauld
> I have been using winpdb recently, it is a pretty decent standalone Python > debugger for Windows. http://www.digitalpeers.com/pythondebugger/ It looks the part and I've downloaded a copy. Thamks for the tip, Alan g ___ Tutor maillist - Tutor@py

Re: [Tutor] Please look at my wordFrequency.py

2005-10-11 Thread Andrew P
If it makes you feel any better, this isn't an easy problem to get 100% right, traditionally.  Heck, it might not even be possible.  A series of compromises might be  the best you can hope for. Some things to think about, however.  Can you choose the characters you want, instead of the (many, many

Re: [Tutor] Please look at my wordFrequency.py

2005-10-10 Thread Danny Yoo
> 3) No modularization. Couldn't see a reason to do so. Is there one or > two? Specifically, what sections should become modules, if any? Hi Dick, My recommendation is to practice using and writing functions. For example, this block here is a good candidate to box off as a named function: ###

Re: [Tutor] Please look at my wordFrequency.py

2005-10-10 Thread Kent Johnson
Dick Moores wrote: > Specifically, I'm hoping for comments on or help with: > 1) How to debug. I'm using v2.4, IDLE on Win XP. I have been using winpdb recently, it is a pretty decent standalone Python debugger for Windows. Start it with the -t switch so you don't need the Python Cryptographic

Re: [Tutor] Please look at my wordFrequency.py

2005-10-10 Thread Alan Gauld
> Has anyone else experienced this? I tried debugging in IDLE with the > source checkbox enabled, but when the sourcecode window lost focus as > I clicked back on the debugger window to hit the step button, the > highlight indicating the current line of source was no longer visible. > It's probably

Re: [Tutor] Please look at my wordFrequency.py

2005-10-10 Thread John Fouhy
On 11/10/05, Dick Moores <[EMAIL PROTECTED]> wrote: > I worked on this a LONG time for something I expected to just be an easy > and possibly useful exercise. Three times I started completely over with > a new approach. Had a lot of trouble removing exactly the characters I > didn't want to appear

Re: [Tutor] Please look at my wordFrequency.py

2005-10-10 Thread R. Alan Monroe
> IDLE's debugger isn't pretty but it does work, try it. > Use the context menus and mouse to set a break point, > then just step through using the step and next buttons. Has anyone else experienced this? I tried debugging in IDLE with the source checkbox enabled, but when the sourcecode window lo

Re: [Tutor] Please look at my wordFrequency.py

2005-10-10 Thread Alan Gauld
> didn't want to appear in the output. Wished I knew how to debug other than > just by using a lot of print statements. When you need to get to the nitty gritty you need to use a realdebugger. The best GUI one is probably the one in Pythonwin. The standard one is PDB and the tutorial on it is OK

[Tutor] Please look at my wordFrequency.py

2005-10-10 Thread Dick Moores
Script is at: Example text file for input: (142 kb) (from ) Example output in file: