[Tutor] Data storage, SQL?

2005-02-10 Thread Liam Clarke
Hi, I'm looking to create a prog that will store disparate bits of info all linked together, i.e. address details for a person, transaction records, specific themes, and the ability to search by certain criteria, so I'm pretty sure I want a database. Can anyone recommend a useful database librar

Re: [Tutor] Perl Symbology (was: Are you allowed to shoot camels?)

2005-02-10 Thread Hugo González Monteverde
Smith, Jeff wrote: But in my mind nothing beats the Perl statement: newstr = "$s $n $r"; for clarity, ease of use, and maintainability. Only a little ease of use is lost with the following in Python, clarity and maintainability are kept, and it even will let you format the output (as in # of deci

Re: [Tutor] Perl Symbology (was: Are you allowed to shoot camels?)

2005-02-10 Thread Max Noel
On Feb 10, 2005, at 19:50, Bill Mill wrote: so "#{} . Here, [symbol] refers to the scope(?) of the variable. See the discussion between me and Alan on this topic a while ago -- the use of these symbols being his main criticism of Ruby. foo is a local variable $foo is a global variable @foo is a

Re: [Tutor] Perl Symbology

2005-02-10 Thread Bill Mill
Kent, On Thu, 10 Feb 2005 13:43:21 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote: > Python 2.4 includes a string.Template class which does much the same thing as > Itpl.itpl(): > > >>> from string import Template > >>> s, n, r = '0', 12, 3.4 > >>> x = Template("$s $n $r") > >>> x.substit

Re: [Tutor] Perl Symbology (was: Are you allowed to shoot camels?)

2005-02-10 Thread Bill Mill
On Thu, 10 Feb 2005 19:28:26 -, Alan Gauld <[EMAIL PROTECTED]> wrote: > > Although it's worse with: > > newstr = s + ' ' + str(n) + ' ' + str(r) > > You could try: > > newstr = s + ' ' + `n` + ' ' + `r` > > if you think thats better. > But `` is different to str() for some types. > > Person

Re: [Tutor] Perl Symbology (was: Are you allowed to shoot camels?)

2005-02-10 Thread Alan Gauld
> Although it's worse with: > newstr = s + ' ' + str(n) + ' ' + str(r) You could try: newstr = s + ' ' + `n` + ' ' + `r` if you think thats better. But `` is different to str() for some types. Personally I prefer the formatting approach. > But in my mind nothing beats the Perl statement: > new

Re: [Tutor] Perl Symbology

2005-02-10 Thread Kent Johnson
Bill Mill wrote: Kent, On Thu, 10 Feb 2005 13:43:21 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote: Python 2.4 includes a string.Template class which does much the same thing as Itpl.itpl(): I just didn't want to give an answer that only works in python 2.4, and one furthermore which I have not test

RE: [Tutor] Re: Perl Symbology

2005-02-10 Thread Smith, Jeff
Abel, No, you don't have to escape them all. Perl treats single and double quotes differently. Single-quoted strings don't do interpolation and double-quoted strings do. Jeff -Original Message- From: Abel Daniel [mailto:[EMAIL PROTECTED] Sent: Thursday, February 10, 2005 12:23 PM To

Re: [Tutor] Perl Symbology

2005-02-10 Thread Kent Johnson
Python 2.4 includes a string.Template class which does much the same thing as Itpl.itpl(): >>> from string import Template >>> s, n, r = '0', 12, 3.4 >>> x = Template("$s $n $r") >>> x.substitute(locals()) '0 12 3.4' If you want to bundle this up in a pp() function you have to do some magic to

Re: [Tutor] Re: Perl Symbology

2005-02-10 Thread Bill Mill
On Thu, 10 Feb 2005 18:22:30 +0100, Abel Daniel <[EMAIL PROTECTED]> wrote: > Bill Mill writes: > > > I get the impression that many pythonistas don't like string > > interpolation. I've never seen a clear definition of why. > >From "import this": > > Explicit is better than implicit. > > An

Re: ****SPAM(10.2)**** [Tutor] Re: python's default argument value handling in functions - weird syntax? problem grappling with the concept

2005-02-10 Thread Bob Gailer
I regret my original answer since it led to frustration. I missed the point that the local variable is pointed to the once-created default object, and that reassigning to that name does NOT affect the once-created default object. I am glad for a community in which we can cover each other's blind

[Tutor] Re: Perl Symbology

2005-02-10 Thread Abel Daniel
Bill Mill writes: > I get the impression that many pythonistas don't like string > interpolation. I've never seen a clear definition of why. >From "import this": Explicit is better than implicit. And doesn't perl's method mean that you have to escape _every_ _single_ '$' in strings? I think

Re: [Tutor] Perl Symbology (was: Are you allowed to shoot camels?)

2005-02-10 Thread Bill Mill
Sorry for the double post; I forgot one thing: On Thu, 10 Feb 2005 10:43:28 -0500, Bill Mill <[EMAIL PROTECTED]> wrote: > Jeff, > > I get the impression that many pythonistas don't like string > interpolation. I've never seen a clear definition of why. Anyway, it's > easy enough to add with the I

Re: [Tutor] Perl Symbology (was: Are you allowed to shoot camels?)

2005-02-10 Thread Bill Mill
Jeff, I get the impression that many pythonistas don't like string interpolation. I've never seen a clear definition of why. Anyway, it's easy enough to add with the Itpl [1] module: >>> import Itpl, sys >>> sys.stdout = Itpl.filter() >>> s, n, r = 0, 0, 0 >>> print "$s $n $r" 0 0 0 >>> x = Itpl.

[Tutor] Perl Symbology (was: Are you allowed to shoot camels?)

2005-02-10 Thread Smith, Jeff
To all those who talked about hating the symbology in Perl and the suggestion that it should be removed from a later version. I just remembered what you get for that symbology that I really do like about Perl: variable interpolation in strings: C: sprintf(newstr,"%s %d %f",s,n,r); Becomes a litt

Re: [Tutor] Hex to Str - still an open issue

2005-02-10 Thread R. Alan Monroe
> I am not so clued up on the 'base 2' and 'base 8' stuff. > Care to explain that a little? Easy. Imagine the numerals 2,3,4,5,6,7,8,9 were never invented. You'd start counting at 0. Next would come 1. Now you've maxed out your first column so you have to carry to the next column, so next would c

Re: [Tutor] help with refactoring needed -- which approach is morePythonic?

2005-02-10 Thread Kent Johnson
Alan Gauld wrote: The main change in refactoring is moving it to OOP. I have a method that serves as the entry point for parsing the files. Not an object? If you are thinking terms of what the methods do its probably not OOP... I would expect to see an object for the File, another for the Header,

Re: [Tutor] help with refactoring needed -- which approach is morePythonic?

2005-02-10 Thread Brian van den Broek
Alan Gauld said unto the world upon 2005-02-10 02:58: The main change in refactoring is moving it to OOP. I have a method that serves as the entry point for parsing the files. Not an object? If you are thinking terms of what the methods do its probably not OOP... Hi Alan, That may well be :-) What

Re: [Tutor] Hex to Str - still an open issue

2005-02-10 Thread Brian van den Broek
Johan Geldenhuys said unto the world upon 2005-02-10 00:43: I am not so clued up on the 'base 2' and 'base 8' stuff. Care to explain that a little? Johan On Tue, 2005-02-08 at 12:12, Pierre Barbier de Reuille wrote: Hi Johan, here's a go: We have 10 fingers. Not coincidentally, we have a base 10 n

Re: [Tutor] Hex to Str - still an open issue

2005-02-10 Thread Max Noel
On Feb 10, 2005, at 05:43, Johan Geldenhuys wrote: I am not so clued up on the 'base 2' and 'base 8' stuff. Care to explain that a little? Usually, we use base 10 numbers, that is, numbers that can be represented with 10 symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, 9). Binary, or base 2, represents all

Re: [Tutor] Hex to Str - still an open issue

2005-02-10 Thread Alan Gauld
> I am not so clued up on the 'base 2' and 'base 8' stuff. > Care to explain that a little? base 2 is binary, base 8 is octal. We normally use base 10 decimal. The base refers to the biggest number that can be represented by a single digit. (Actually one less than the base because we start with

Re: e-mail address change (was Re: [Tutor] python's default argumentvalue handling in functions - weird syntax? problem grappling withthe concept)

2005-02-10 Thread Alan Gauld
> >def f(a,L=[]): > >if L==[5]: > >print 'L==[5] caught' > >print L > >print 'resetting L...' > >L=[] > >L.append(a) > >return L > > > > > >### > > > Now I'm dizzy... I can't understand why there are two "L"! > L is a local variable of the function, right

Re: [Tutor] help with refactoring needed -- which approach is morePythonic?

2005-02-10 Thread Alan Gauld
> The main change in refactoring is moving it to OOP. I have a method > that serves as the entry point for parsing the files. Not an object? If you are thinking terms of what the methods do its probably not OOP... I would expect to see an object for the File, another for the Header, a third for t