Re: symbolic links, aliases, cls clear

2006-04-15 Thread Chris F.A. Johnson
On 2006-04-13, Barry Margolin wrote: In article [EMAIL PROTECTED], Chris F.A. Johnson [EMAIL PROTECTED] wrote: In fact, my scripts are portable to other terminal types by use of files for each terminal, generated with tput. Using a different terminal is as easy as . /usr

Re: symbolic links, aliases, cls clear

2006-04-12 Thread Chris F.A. Johnson
the appropriate database (TERMINFO or TERMCAP), and the easy way to do that is, tput clear I still have a system which does not have tput. -- Chris F.A. Johnson, author |http://cfaj.freeshell.org Shell Scripting Recipes: | My code in this post, if any, A Problem-Solution Approach

Re: symbolic links, aliases, cls clear

2006-04-12 Thread Chris F.A. Johnson
On 2006-04-12, Floyd L. Davidson wrote: Keith Thompson [EMAIL PROTECTED] wrote: tput clear (Or clear.) But /clear/ merely uses tput clear. Not on systems without tput. -- Chris F.A. Johnson, author |http://cfaj.freeshell.org Shell Scripting Recipes: | My code

Re: symbolic links, aliases, cls clear

2006-04-12 Thread Chris F.A. Johnson
On 2006-04-12, jpd wrote: Begin [EMAIL PROTECTED] On 2006-04-12, Chris F.A. Johnson [EMAIL PROTECTED] wrote: These days, the ISO-6429 standard (almost the same as the older ANSI x3.64) is so close to universal that I don't bother writing for anything else any more. Oh, wonderful

Re: symbolic links, aliases, cls clear

2006-04-12 Thread Chris F.A. Johnson
On 2006-04-12, Christos Georgiou wrote: On Wed, 12 Apr 2006 15:59:05 -0400, rumours say that Chris F.A. Johnson [EMAIL PROTECTED] might have written: I still have a system which does not have tput. And that justifies everything else. Of course. If I want to write portable scripts

Re: symbolic links, aliases, cls clear

2006-03-29 Thread Chris F.A. Johnson
between aliases and symbolic links? What's the difference between a raven and a writing desk? if i execute a command like 'clear' to clear the screen, where does the shell look to find the command 'clear'? In a directory listed in the PATH variable. -- Chris F.A. Johnson, author

Re: Spelling mistakes!

2006-01-08 Thread Chris F.A. Johnson
or belittle. Some dictionaries give 'depreciate' as a definition of 'deprecate'. -- Chris F.A. Johnson, author |http://cfaj.freeshell.org Shell Scripting Recipes: | My code in this post, if any, A Problem-Solution Approach | is released under the 2005, Apress

Re: Spelling mistakes!

2006-01-08 Thread Chris F.A. Johnson
On 2006-01-08, Robin Becker wrote: Chris F.A. Johnson wrote: On 2006-01-08, Terry Hancock wrote: BTW, one of the most common programming spelling errors is deprecate versus depreciate -- I wonder how many people actually realize that both words exist, but have entirely different meanings

Re: reading files into dicts

2005-12-29 Thread Chris F.A. Johnson
On 2005-12-30, Tim Williams (gmail) wrote: Apologies for the top post, it was my first attempt at using gmail's pda-enabled web interface. There is no option to bottom post. Can you not move the cursor? -- Chris F.A. Johnson, author |http://cfaj.freeshell.org Shell Scripting

Re: i=2; lst=[i**=2 while i1000]

2005-12-06 Thread Chris F.A. Johnson
*are* missing something obvious]. What does i**=2 do if not change i? i=2 lst=[] while i1000: ... i**=2 ... lst.append(i) ... lst [4, 16, 256, 65536] -- Chris F.A. Johnson, author |http://cfaj.freeshell.org Shell Scripting Recipes: | My code in this post

Re: wxPython Licence vs GPL

2005-11-26 Thread Chris F.A. Johnson
a different license. -- Chris F.A. Johnson, author |http://cfaj.freeshell.org Shell Scripting Recipes: | My code in this post, if any, A Problem-Solution Approach | is released under the 2005, Apress | GNU General Public Licence -- http

Re: os.popen('alias')

2005-11-18 Thread Chris F.A. Johnson
in a file before calling python, and read that file. -- Chris F.A. Johnson, author |http://cfaj.freeshell.org Shell Scripting Recipes: | My code in this post, if any, A Problem-Solution Approach | is released under the 2005, Apress | GNU General Public

Re: os.popen('alias')

2005-11-18 Thread Chris F.A. Johnson
On 2005-11-19, Chris F.A. Johnson wrote: On 2005-11-18, Belebele wrote: From an interactive python shell, I execute the following: import os for line in os.popen('alias').readlines(): print line No aliases are printed. I started

Re: Goto XY

2005-11-08 Thread Chris F.A. Johnson
://www.unixreview.com/documents/s=9920/ur0511a/ur0511a.html; the code there is for the shell, but translating them to python should be straightforward. I'll probably do it myself when I have the time or the motivation. -- Chris F.A. Johnson | Author: http

Re: Goto XY

2005-11-08 Thread Chris F.A. Johnson
On 2005-11-09, Jean-Paul Calderone wrote: On Tue, 8 Nov 2005 22:33:47 -0500, Chris F.A. Johnson [EMAIL PROTECTED] wrote: [snip] To read a single keystroke, see Claudio Grondi's post in the thread python without OO from last January. Function and cursor keys return more than

Re: Goto XY

2005-11-08 Thread Chris F.A. Johnson
On 2005-11-09, Grant Edwards wrote: On 2005-11-09, Chris F.A. Johnson [EMAIL PROTECTED] wrote: Is there some command in python so that I can read a key's input and then use a gotoxy() function to move the cursor on screen? e.g.: (psuedo-code) You can use curses, but that may be more

Re: Getting Python Accepted in my Organisation

2005-11-05 Thread Chris F.A. Johnson
On 2005-11-05, Steven D'Aprano wrote: On Fri, 04 Nov 2005 20:55:48 -0500, Chris F.A. Johnson wrote: quoting deliberately removed to make a point So that people reading your reply know what you are commenting about. (Now, imagine that you're reading from a newsgroup where Chris' post has

Re: Getting Python Accepted in my Organisation

2005-11-04 Thread Chris F.A. Johnson
to the next original material. I would only do in-line response type when there is a need for specific response in context. If there's not, why would you quote anything? -- Chris F.A. Johnson | Author: http://cfaj.freeshell.org | Shell Scripting Recipes: Any

Re: Windows vs Linux [was: p2exe using wine/cxoffice]

2005-10-26 Thread Chris F.A. Johnson
will be indebted to them and it will increase my chances of switching to Linux a bit! (Although not at work where I have no choice!) In my ~/.inputrc: \e[a: history-search-backward ## shift+up-arrow \e[b: history-search-forward ## shift+down-arrow -- Chris F.A. Johnson

Re: An interesting question about print '\a'

2005-10-23 Thread Chris F.A. Johnson
to the client machine? The code is printed to stdout, which is your terminal. Your terminal interprets ^G as a beep. -- Chris F.A. Johnson http://cfaj.freeshell.org == Shell Scripting Recipes

Re: best way to replace first word in string?

2005-10-22 Thread Chris F.A. Johnson
. In a python program, one of the solutions already posted will be much faster. -- Chris F.A. Johnson http://cfaj.freeshell.org == Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress http

Re: best way to replace first word in string?

2005-10-22 Thread Chris F.A. Johnson
On 2005-10-22, William Park wrote: Chris F.A. Johnson [EMAIL PROTECTED] wrote: On 2005-10-22, William Park wrote: [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I am looking for the best and efficient way to replace the first word in a str, like this: aa to become - /aa/ to become I know I

Re: Set an environment variable

2005-10-21 Thread Chris F.A. Johnson
will not affect its parent (i.e., the process that called it). -- Chris F.A. Johnson http://cfaj.freeshell.org == Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress http://www.torfree.net

Re: how to improve simple python shell script (to compile list of files)

2005-10-15 Thread Chris F.A. Johnson
; ^ SyntaxError: invalid syntax Jari -- Chris F.A. Johnson http://cfaj.freeshell.org == Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress http://www.torfree.net

Re: HELP: Searching File Manager written in Python

2005-10-11 Thread Chris F.A. Johnson
can execute on a selected file I use gentoo (the file manager, not the Linux distro). It's not written in Python, but you can define buttons that will run any commands you like with the selected file[s] as arguments. http://www.obsession.se/gentoo/ -- Chris F.A. Johnson

Re: How do i read just the last line of a text file?

2005-05-29 Thread Chris F.A. Johnson
On Sun, 29 May 2005 at 05:57 GMT, John Machin wrote: Chris F.A. Johnson wrote: file = open(argv[1]) ## Open the file given on the command line all_lines = file.readlines() ## Read all the lines I see your shadowing and raise you one obfuscation: ;) open = file(argv[1

Re: need help of RE

2005-05-29 Thread Chris F.A. Johnson
(Word2|woRd3)) s = re.sub([^a-zA-Z0-9]+, ,str).split() -- Chris F.A. Johnson http://cfaj.freeshell.org == Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress http://www.torfree.net/~chris

Re: How do i read just the last line of a text file?

2005-05-28 Thread Chris F.A. Johnson
]) ## Open the file given on the command line all_lines = file.readlines() ## Read all the lines last_line = all_lines[-1] ## Assign the last line -- Chris F.A. Johnson http://cfaj.freeshell.org