Newbie: Why doesn't this work

2007-12-31 Thread ct60
Hi Python Community: Despite my new-ness to Python I have alreadhy been able to do some (I think) amazing things. It is a truly elegant and smart language. Yet, I can not seem to get a handle on something simple. I would like to make a class which has private varaiables fName and lName. It sh

Re: Newbie: Why doesn't this work

2007-12-31 Thread ct60
Thanks you Gabriel and Timm for your thoughtful responses. I am very appreciative. I had heard about the properties function, but wanted to understand the old syntax first before I tried that. Thanks to your responses, I was able to see what the problem was. Here is a solution I came up with:

Using Regular Expressions to Parse SQL

2008-02-05 Thread ct60
Hello again - I do not seem to be able to get a handle on non-greedy pattern matching. I am trying to parse the following - note that there are no line breaks in the string: " FROM ((qry_Scores_Lookup1 INNER JOIN CSS_Rpt1 ON (qry_Scores_Lookup1.desc = CSS_Rpt1.desc) AND (qry_Scores_Lookup1.lastc

Re: Using Regular Expressions to Parse SQL

2008-02-05 Thread ct60
Firstly, thanks to those who posted. I just do not understand how the non-greedy operator works. Using the following code: import re s = "qry_Lookup.desc = CSS_Rpt1.desc AND qry_Lookup.lcdu1 = CSS_Rpt1.lcdu" pat = "(.+=)+?(.+)" m = re.match(pat, s) if m is None: print "No Match" else: