[Tutor] Update BLOB with odbc

2006-08-02 Thread Ron Phillips
It must be easier than I am making it. sql = "UPDATE sa2.outfalls SET photo_content = %s WHERE pppoint_id ='"+record[0].strip()+"';" newsql = sql%pstuff print newsql[:150] cursor.execute(newsql) __ the print newsql[:

Re: [Tutor] MySQLdb question.

2006-07-28 Thread Ron Phillips
That was it all right! Thanks, Kent! Ron___Ron Phillips wrote: > I am trying to write a script that adds data to a table using > MySQLdb.py. For some reason, "INSERT" seems to work temporarily. I > run a command to insert a row, and then do a select query, and it's > there. Aft

[Tutor] MySQLdb question.

2006-07-28 Thread Ron Phillips
I am trying to write a script that adds data to a table using MySQLdb.py.  For some reason, "INSERT" seems to work temporarily. I run a command to insert a row, and then do a select query, and it's there. After the program shuts down, though, it's gone. No rows are permanently created. SELECT wor

Re: [Tutor] making a python program part of xhtml

2006-06-09 Thread Ron Phillips
>>> Emily Fortuna < [EMAIL PROTECTED] > 6/8/2006 9:19 AM >>> Hola everyone, I'm working on creating a webpage in which a user can submit data into fields to be held in a database (there are other details, but this is the gist of the idea), and I need to use python. I am unfamiliar with manipulat

Re: [Tutor] web intefaces?

2006-05-09 Thread Ron Phillips
I like Karrigell ...http://www.karrigell.com/ for being flexible, complete, lightweight, and easy to learn. I don't know how it scales, but that's not really a consideration for the applications you describe.   Ron>>> "Chad Crabtree" <[EMAIL PROTECTED]> 5/8/2006 6:29 PM >>>While everything that A

Re: [Tutor] Brain In Vice: Why is this so fun to me?

2006-04-21 Thread Ron Phillips
Regex aside, just for a moment — the subject line gets my vote for "Most Succinct Description of Programmer Mindset", if there's a competition on.   Ron ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] preliminary app design question

2006-04-06 Thread Ron Phillips
You might also consider JSON (http://www.json.org), which is generally lighter weight than XML, fairly human-readable, and useful in several languages (most, anymore) . Python, Javascript, and ECMAScript use it natively through Eval(), if you don't have security concerns; or through a wrapper if se

Re: [Tutor] Printing

2005-12-28 Thread Ron Phillips
>>> "John Corry" < [EMAIL PROTECTED] > 12/24/2005 12:28 PM >>>Hi + Season's Greetings!I have put together a program that queries and modifies a Gadfly database.I have captured my output. I now want to print it to paper.I have written the output to a text file. I have searched the tutor mailinglist

Re: [Tutor] Favourite modules - Wiki Was Re: TurboGears - and some issues

2005-11-15 Thread Ron Phillips
>>> Ismael Garrido <[EMAIL PROTECTED]> 11/14/2005 11:55 PM >>> Kent Johnson wrote: >Maybe we should start a thread of favorite addons. For me, Jason Orendorff's path module is definitely #1 on the list, probably followed by Fredrik Lundh's ElementTree. > http://www.jorendorff.com/articles/python/p

[Tutor] Thanks, you prevented "Coder's Remorse"

2005-10-03 Thread Ron Phillips
Thanks to everyone who responded to my "Prevent Coder's Remorse" posting; the result of combining the ideas that you contributed is below. It's a little long, but I'm delighted with it so far, and maybe someone else can use it. It's nice for representing a sparse table, where all the records sha

Re: [Tutor] Prevent "Coder's Remorse"?

2005-09-28 Thread Ron Phillips
Ok, I have three diverse answers from three of the tutors that I respect most. Kent Johnson's approach: subclass dict and overloads the __getitem__ , __setitem__, and __delitem__ methods. Alan G's idea: ". . . Get the init method to update a global (or class based) list of instances and writ

[Tutor] Prevent "Coder's Remorse"?

2005-09-28 Thread Ron Phillips
Kent Johnson wrote: I'm curious about why you want to do this, it is kind of a strange requirement. Yeah, that was bothering me, too. I was a little unsure if I'd even defined the problem properly; that's what I meant by: "Am I even asking the right questions?" I'll play around with the class

[Tutor] Prevent "Coder's Remorse"?

2005-09-28 Thread Ron Phillips
hat forces all members to have the same keys? Is there an object structure that will let updates to one instance affect all instances? Am I even asking the right questions? I suspect there's an elegant solution, but it's beyond me right now. If not, fine; I'll happily go on w

Re: [Tutor] [tutor]web development

2005-09-28 Thread Ron Phillips
Well, I won't argue with anyone who chooses otherwise, but CherryPy http://www.cherrypy.org/ is easy to use, lightweight, quick, and pythonic. I write everything as plain old python, then webify it the very last thing.   It's also the basis of a new, promising framework called TurboGears http://

[Tutor] Stuck: unicode in regular expressions

2005-08-09 Thread Ron Phillips
I am expecting users to cut-and-paste DMS data into an application — like:  +40 30 15   E40 15 34.56, -81 0 0,   81 57 34.27E, W 40° 13’ 27.343”, 40° 13’ 27.343” S, 140° 13’ 27.343”S, S40° 13’ 27.34454,  81:57:34.27E    I've been able to write a regex that seems to work in redemo.py, but it doesn

Re: [Tutor] how to add python code to a webpage

2005-07-18 Thread Ron Phillips
Mustafa Abbasi asked:   i want to create a simple page which has a formand takes in persons date of birth and give out exact age.how do i add python codeto an html page.i don't have any dreamweaver or frontpage.this is basically cuz some freinds advised me to create this isnce i am learning prog

Re: [Tutor] CGIXMLRPCRequestHandler doesn't actually work, does it?

2005-06-24 Thread Ron Phillips
Yes, I believe you are right -- I posted a reply to the list indicating that I suspect IIS is at fault; not Python. Or perhaps I should say "my installation of IIS"; I have no confidence whatsoever in my abilities to administer IIS properly.   Thanks for looking at the documentation -- I was stuc

Re: [Tutor] CGIXMLRPCRequestHandler doesn't actually work, does it?

2005-06-24 Thread Ron Phillips
Kent wrote:   CGI requires a running HTTP server in front of it. The server receives the HTTP request, sees that it is a CGI request, starts a new process with the environment set according to the CGI protocol, and runs the CGI handler. Do you understand this relationship? (I mean that kindly, yo

Re: [Tutor] CGIXMLRPCRequestHandler doesn't actually work, does it?

2005-06-24 Thread Ron Phillips
##Run a simple CGI server by opening a command line to the parent dir of cgi-bin and runningpython -c "import CGIHTTPServer; CGIHTTPServer.test()"   ##   Oh, dear -- I responded before I read your post, Kent. It turns out it was option b), after all. But I had NO idea I would need to do anything

Re: [Tutor] CGIXMLRPCRequestHandler doesn't actually work, does it?

2005-06-24 Thread Ron Phillips
rs -- thanks again for responding!) was about xmlrpclib on the client side, not CGIXMLRPCRequestHandler on the server side, I can now conclude that it is terribly difficult, and slink off to publish using SOAP.   Ron     On 6/23/05, Ron Phillips <[EMAIL PROTECTED]> wrote:>  > I believe I'

[Tutor] CGIXMLRPCRequestHandler doesn't actually work, does it?

2005-06-22 Thread Ron Phillips
I believe I've tried every setting known to man, in every script in every little scrap of documentation available. XMLRPC requests using SimpleXMLRPCRequestHandler -- no problem. But try to run them as a CGI script, and I get system lock ups and that's all. No error codes; no response whatsoever.

Re: [Tutor] Am I making this harder than it needs to be?

2005-05-26 Thread Ron Phillips
Ron Phillips wrote:>> short version: I  need a way to get max and min E and N out of >> [(E0,N0),(E1,N1)...(En,Nn)] without reordering the list>>> Kent Johnson [EMAIL PROTECTED]> 5/25/2005 10:19 AM >>>For Python < 2.4 you need another set of [ ] e.g. min([e

Re: [Tutor] Am I making this harder than it needs to be?

2005-05-25 Thread Ron Phillips
;t know if that what you want.good luckpujoOn 5/25/05, Ron Phillips <[EMAIL PROTECTED]> wrote:>  > short version: I  need a way to get max and min E and N out of> [(E0,N0),(E1,N1)...(En,Nn)] without reordering the list >   > long version: >   > I would like a list of geogra

[Tutor] Am I making this harder than it needs to be?

2005-05-25 Thread Ron Phillips
short version: I  need a way to get max and min E and N out of [(E0,N0),(E1,N1)...(En,Nn)] without reordering the list   long version:   I would like a list of geographic coordinates (Easting, Northing) to maintain a "bounding box" [(minEasting,minNorthing),(maxEasting,maxNorthing)] attribute.  

Re: [Tutor] Opinions about this GIS script

2005-05-17 Thread Ron Phillips
Thank you, Andrei, that's just what I was hoping for -- I wondered about some of those issues, but was a little unsure how to approach a solution.   Ron     ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Opinions about this GIS script

2005-05-16 Thread Ron Phillips
'shareable' python. Everything else I've done so far is either a quick-and-dirty for my own use, or a simple illustration for instructional purposes.   The script produces expected results, but if anyone is so inclined, I'd appreciate review/evaluation/critique of the 'python

Re: [Tutor] Negative IF conditions

2005-02-14 Thread Ron Phillips
And now for something only slightly different: education research shows that people process "positives" far more quickly and accurately than "negatives", so for readability I often code like:   if os.path.exists('filename')     #no-operation else     #operation   YMMV, of course.   Ron At 08:5

[Tutor] Re:OT

2004-12-29 Thread Ron Phillips
54 years old -- father of 3, grandfather of 4 (and counting.)   I started Pythoning because I work for a governmental agency that does Civil Engineering. To support mapping, I needed a wrapper for ESRI products (Python, AML, VBA), to support drafting, I needed a wrapper for AutoDesk products

[Tutor] Re: [ANN] RUR: a Python Learning Environment (alpha)

2004-12-13 Thread Ron Phillips
Can't get it running -- it keeps saying:   Traceback (most recent call last):  File "C:/source/RUR/RURmain.py", line 28, in ?    messenger.loadImages()    # load them up here after initialising Handlers  File "C:\source\RUR\messenger.py", line 27, in loadImages    HIT_WALL_IMAGE = wxImage('

[Tutor] Re: [ANN] RUR: a Python Learning Environment (alpha)

2004-12-13 Thread Ron Phillips
This looks like a very nice effort -- I am trying to get it running, since I am working with some other newbies to learn more Python.   I wish there were a link from http://rur-ple.sourceforge.net/index.html to the download page! And I am not sure which of the downloaded files to run. I thou

[Tutor] Graphics coordinates (bump?)

2004-12-10 Thread Ron Phillips
sCE. WindowsCE has a fairly plain-vanilla Python build, so it's better if I stick to the core modules as far as possible.   Ron Phillips ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

[Tutor] Re: PDF and Python

2004-12-10 Thread Ron Phillips
I just happened across an answer yesterday. PIL writes PDF s.   http://www.pythonware.com/products/pil/   Ron ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

[Tutor] Graphics coordinates

2004-12-09 Thread Ron Phillips
-code, but I don't want to reinvent the wheel if there are existing modules that do almost (or even better, exactly) what I need.   I work on WinXp, Linux, and WindowsCE. WindowsCE has a fairly plain-vanilla Python build, so it's better if I stick to the core modules as far as possible.