Re: Dive Into Python -- Still Being Updated?

2006-07-26 Thread cga2000
On Tue, Jul 25, 2006 at 11:32:23PM EDT, [EMAIL PROTECTED] wrote:
> 
> Alan Franzoni wrote:
> > Il 22 Jul 2006 15:48:36 -0700, [EMAIL PROTECTED] ha scritto:
> >
> > > http://diveintopython.org/getting_to_know_python/indenting_code.html
> > >
> > > The function called fib (presumably short for Fibonacci) appears to
> > > produce factorials. Anyway, 'fib' should really be called 'hem'. :)
> >
> > I think this is just a bad name for the function... it's not stated
> > anywhere that it should return a Fibonacci sequence.
> 
> Well, yeah, my point. It's misleading. 

.. a "fib".. as in "telling fibs.." 

so the function lies .. therefore it does not return a Fibonacci
sequence..

???
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: email client like mutt

2006-08-07 Thread cga2000
On Sun, Aug 06, 2006 at 04:15:08PM EDT, Aahz wrote:
> In article <[EMAIL PROTECTED]>,
> Fabian Braennstroem  <[EMAIL PROTECTED]> wrote:
> >
> >I am looking for a python email client for the terminal... something like
> >mutt; maybe, so powerfull ;-)
> 
> What's wrong with mutt?

Like he says it's not written in python.

Thanks

cga
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: email client like mutt

2006-08-07 Thread cga2000
On Mon, Aug 07, 2006 at 08:34:16PM EDT, Aahz wrote:
> In article <[EMAIL PROTECTED]>,
> cga2000  <[EMAIL PROTECTED]> wrote:
> >On Sun, Aug 06, 2006 at 04:15:08PM EDT, Aahz wrote:
> >> In article <[EMAIL PROTECTED]>,
> >> Fabian Braennstroem  <[EMAIL PROTECTED]> wrote:
> >>>
> >>>I am looking for a python email client for the terminal... something like
> >>>mutt; maybe, so powerfull ;-)
> >> 
> >> What's wrong with mutt?
> >
> >Like he says it's not written in python.
> 
> Yes, I see that, but that doesn't answer my question.  Not every
> application in the world needs to be written in Python.  (Note that I'm
> a mutt user myself.)

Well.. I'm also curious why he wants it to be written in python, so I
thought we could join forces.

Incidentally I've been looking for a general-purpose application written
in python/ncurses for some time and haven't found anything.

Looks like no new terminal application was written in the last ten years
or so. I guess that would rule out python..?

Thanks

cga
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: using python at the bash shell?

2006-08-15 Thread cga2000
On Tue, Aug 08, 2006 at 12:22:42PM EDT, Simon Forman wrote:
> John Salerno wrote:
> > [EMAIL PROTECTED] wrote:
> > > John> Aside from the normal commands you can use, I was wondering if
> > > John> it's possible to use Python from the terminal instead of the
> > > John> normal bash commands (e.g. print instead of echo).
> > >
> > > Take a look at ipython .  It's not precisely 
> > > what
> > > you've asked for, but it provides some features that help integrate Python
> > > with the shell environment.
> > >
> > > Skip
> >
> > Can you use IPython to do normal bash things, like installing, etc.?
> 
> "normal bash things"? :-)  Yes, most commands can be run by putting an
> '!' before them.  If you ever need to run something that for some
> reason doesn't work with this, you can always run !bash and do it in
> bash.  :-)
> 
Sorry, I'm late with my howmework .. but this is rather cool.

Although .. prefixing all your "system commands" with the far-to-reach
"!" would probably become a royal pain after a while.

Why do you write "most commands" .. what type of command might not be
run by "putting '!' before them?"

In the linux world it would be rather interesting if a distro was
available that uses nothing but python. 

The installer .. the startup scripts .. utilities .. etc.

Maybe there is such a thing and I'm just not aware of it?

Since it would be byt-code being executed it would be faster than
regular shell stuff and a lot easier to customize/maintain.

Don't know enough to figure out if such a thing is possible, though ..

Thanks

cga
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: using python at the bash shell?

2006-08-15 Thread cga2000
On Tue, Aug 15, 2006 at 06:45:33PM EDT, Simon Forman wrote:
> cga2000 wrote:
[..]
 > Why do you write "most commands" .. what type of command might not be
> > run by "putting '!' before them?"
> 
> Well, I wrote that just to hedge my bets, but here's an example:  I set
> up lesspipe and source-highlight to add syntax highlighting to various
> file types when viewed through less.  But using "!less neat.py" in
> Ipython doesn't work because (I'm guessing here) Ipython doesn't handle
> the color escape codes.  It winds up looking like this:
> 
> ESC[31m#!/usr/local/bin/python2.5ESC[m
> ESC[01;34mfromESC[m random ESC[01;34mimportESC[m random as f
> 
> 
> ESC[01;34mdefESC[m
> ESC[01;30mgESC[mESC[31m(ESC[mESC[31m)ESC[mESC[31m:ESC[m
> n1 ESC[31m=ESC[m ESC[01;30mfESC[mESC[31m(ESC[mESC[31m)ESC[m
> ESC[01;34mwhileESC[m TrueESC[31m:ESC[m
> n2 ESC[31m=ESC[m ESC[01;30mfESC[mESC[31m(ESC[mESC[31m)ESC[m
> yield n1 ESC[31m-ESC[m n2
> n1 ESC[31m=ESC[m n2
> 
> Ew.
> 
> So in this case I'd have to "!bash" then "less neat.py"...

you could use "vim -R" -- or its alter ego "view" ..

"!view neat.py"

I tried that just now under ipython and I end up with the exact same
syntax highlighting that I have when I run vim from the bash prompt.

The problems I am having are mainly due to my bash customization --
aliases, functions .. all that stuff is no longer being recognized ..
and also some bash built-ins such as "cd" do not do anything .. maybe
ipython starts a subprocess that switches and then immediately exits ..
so when I get the prompt back I'm back where I started.

I guess reading the ipython manual and trying to understand what I'm
doing before going any further wouldn't hurt..

:-)
> 
> > In the linux world it would be rather interesting if a distro was
> > available that uses nothing but python.
> >
> > The installer .. the startup scripts .. utilities .. etc.
> >
> > Maybe there is such a thing and I'm just not aware of it?
> 
> IMHO it would be neat,  but it'd be kind of a "stunt".  There's a ton
> of excellent code in most any linux distro *not* written in python.
> 
quite a large project, I would imagine.

> > Since it would be byt-code being executed it would be faster than
> > regular shell stuff and a lot easier to customize/maintain.
> 
> Mmmm...  I bet it'd be hard to beat, say, grep...   Or any of the
> small, custom-purpose C-coded tools.   (then there's make... gcc...
> not easy to rewrite those..   just off the top of my head...)
> 

Sorry .. couldn't think of a better word .. but by "utilities" I meant
all those shell scripts in /usr/bin that come with gnu/linux distros and
mostly appear to front-end "real" programs.

I guess a python "system shell" could invoke all the C-coded stuff the
same way bash does, no..?  

'nuff [OT] for now.. 

Thanks,

cga
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: text editor suggestion?

2006-08-21 Thread cga2000
On Mon, Aug 21, 2006 at 07:59:49AM EDT, Roberto Bonvallet wrote:
> John Salerno wrote:
> > I'd really like to learn vim, but I spent days just trying to figure out 
> > how to get the syntax highlighting and indentation working, where these 
> > settings are and how to edit them, and it still doesn't work for me. It 
> > just feels so insurmountable that I can't even start working with it yet 
> > because I don't know how to tailor the settings.
> 
> Create a vimrc file (if you use Unix: ~/.vimrc) with the following lines in
> it:
> 
> syntax on
> set autoindent
> set smartindent
> 
> If you find that using vim is hard, try using evim (easy vim).  It is part
> of the standard vim distribution (actually it's the same program).  Anyway,
> I suggest learning the classic modal vim, it's really worth it.

I'm not sure anyone else mentioned it.  

One additional feature of Vim that you soon will appreciate is that you
get high quality (and timely) support from very knowledgeable users on
the [email protected] mailing list.

I am unsure whether simpler editors provide this type of thing.

As to creating one's own color schemes .. there are hundreds that can
be downloaded and installed in a matter of minutes and they're likely
much better than what I would be able to come up with.

Some people are just good at this kind of stuff and I'm not one of 'em.

:-)

So, I tried out the ones that looked nice .. selected a few that I liked
more than the others .. and changed a few things that didn't suit me to
create my own modified versions of the originals. 

Thanks

cga
-- 
http://mail.python.org/mailman/listinfo/python-list


Python & ncurses

2006-06-03 Thread cga2000
Can anyone recommend a nice sample application that demonstrates the
capabilities of python+ncurses and a clean/elegant UI?

Thanks,

cga
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Mastering Python

2007-03-16 Thread cga2000
On Fri, Mar 16, 2007 at 09:27:21AM EST, BartlebyScrivener wrote:
> On Mar 16, 8:39 am, "Paul McGuire" <[EMAIL PROTECTED]> wrote:
> >
> > Wow, are you still reading?  Quit wasting time and go download a
> > Python dist and get started already!
> >
> 
> I think you should extract that and spend twenty minutes tidying it up
> and then publish it to the Python for Programmers page or make it a
> downloadable .pdf.

Not sure where it should go.  

Perhaps add a little nook and cranny link named "facts & advocacy".

I'm only an occasional user of Python and admittedly not as well-read as
many on this list .. but I must say that this is the first time I run
into something that so clearly states what makes Python stand apart from
those other ..  er ..  "difficult" .. should I say ..  languages.

Make it a wiki so everyone can add his two cents?

Start a DocBook, LaTex, CSS.. competition and turn it into some kind of
marketing tool with all the trimmings?

In any event it would be a shame to waste it.

Thanks,
cga

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Mastering Python

2007-03-24 Thread cga2000
On Sun, Mar 18, 2007 at 09:38:52PM EST, Paul McGuire wrote:
> On Mar 16, 9:27 am, "BartlebyScrivener" <[EMAIL PROTECTED]> wrote:
> > On Mar 16, 8:39 am, "Paul McGuire" <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Wow, are you still reading?  Quit wasting time and go download a
> > > Python dist and get started already!
> >
> > I think you should extract that and spend twenty minutes tidying it up
> > and then publish it to the Python for Programmers page or make it a
> > downloadable .pdf.
> >
> > http://wiki.python.org/moin/BeginnersGuide/Programmers
> >
> > rd
> >
> >  "The chief contribution of Protestantism to human thought is its
> >   massive proof that God is a bore."
> >
> >   --H.L. Mencken
> 
> I've added it to this page, see the last entry.  Hope some find it
> entertaining, if not informative.

Nice job.

Thanks,
cga
-- 
http://mail.python.org/mailman/listinfo/python-list