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
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
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
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
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
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
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
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
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
*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
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
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
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
://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
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
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
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
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
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
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
.
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
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
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
;
^
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
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
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
(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
]) ## 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
28 matches
Mail list logo