Re: [Tutor] Automatic updates for a program?

2011-05-13 Thread Alan Gauld
Lan Rogers lan.rogers.b...@gmail.com wrote So I have a program I want to release, but it's still in early stages without some of its planned functionality. I want to distribute automatic updates. Don't assume this will be easy, and be prepared for it to cramp your style when it comes to

Re: [Tutor] Just Joined!

2011-05-13 Thread Johnson Tran
Okay I think I understand now. Is there a module i need to import though when defining ?I did a help(module), not sure which module is the correct one to make swapcase.center work properly... On May 12, 2011, at 10:17 AM, Alan Gauld wrote: Alex Smith alexsmith24...@yahoo.com wrote

Re: [Tutor] Just Joined!

2011-05-13 Thread Johnson Tran
You can ignore last question, was trying to figure out Alex's issue as well, but I got it now. sorry for the spam! On May 13, 2011, at 3:57 AM, Johnson Tran wrote: Okay I think I understand now. Is there a module i need to import though when defining ?I did a help(module), not sure which

[Tutor] python file upload

2011-05-13 Thread Rayon
Hi all, I need a python script to upload a xml file to a web page using python. I have tried using pycurl but I am still getting errors. import urllib2 import pycurl data= ?xml version=1.0 encoding=UTF-8? !DOCTYPE ProvisioningRequest SYSTEM ProvisioningRequest.dtd

[Tutor] short url processor

2011-05-13 Thread ian douglas
Hey folks, I'm rewriting a short url processor for my job. I had originally written it as a multi-threaded Perl script, which works, but has socket problems causing memory leaks. Since I'm rebuilding it to use memcache, and since I was learning Python outside of work anyway, figured I'd

[Tutor] Fw: Automatic updates for a program?

2011-05-13 Thread ALAN GAULD
Forwarding to list for wider feedback. Alan Gauld Author of the Learn To Program website http://www.alan-g.me.uk/ - Forwarded Message From: Lan Rogers lan.rogers.b...@gmail.com To: Alan Gauld alan.ga...@btinternet.com Sent: Friday, 13 May, 2011 22:46:41 Subject: Re: [Tutor]

[Tutor] Overriding a method in a class

2011-05-13 Thread Terry Carroll
I have a pretty basic point of confusion that I'm hoping I can have explained to me. I have a class in which I want to override a method, and have my method defined externally to the class definition invoked instead. But when I do so, my external method is invoked with a different argument

Re: [Tutor] short url processor

2011-05-13 Thread Alan Gauld
ian douglas ian.doug...@iandouglas.com wrote outputting what appears to be an apache-style log to STDOUT, but the logging.debug or logging.info calls I make in the code are also going to STDOUT despite my attempt to use logging.basicConfig() overrides and setting a filename, etc. I don;t

Re: [Tutor] Overriding a method in a class

2011-05-13 Thread Terry Carroll
On Fri, 13 May 2011, Terry Carroll wrote: What I *expect* is to see ['abcdefg'] printed. What I get is: Sorry, mixed multiple examples; What I had expected was ['wxyz']. Still the same question though. BTW, I forgot to mention: Python 2.7.1, under Windows. (Still not used to the

Re: [Tutor] Overriding a method in a class

2011-05-13 Thread David Knupp
I think the problem is this bit about overriding an object's internal method with one that is defined externally. My gut feeilng is that you'd now have to explicitly pass the object (i.e., self) as well as the string, i.e.: B.addstuff(B, WXYZ) ...which seems clunky. I'm not familiar with

Re: [Tutor] short url processor

2011-05-13 Thread ian douglas
On 05/13/2011 05:03 PM, Alan Gauld wrote: How do you know they are going to stdout? Are you sure they aren't going to stderr and stderrr is not mapped to stdout (usually the default). Have you tried redirecting stderr to a file for example? As I say, just some thoughts, Thanks for your

[Tutor] Help with exceptions please

2011-05-13 Thread Lea Parker
Hello I have another assignment I am trying to fine tune. The idea is to make sure exceptions work. I have come up with a problem when testing my code. When I enter a golf score for a player the program returns the 'error that has occurred'. I only want it to do this if someone doesn't enter

Re: [Tutor] short url processor

2011-05-13 Thread ian douglas
On 05/13/2011 05:03 PM, Alan Gauld wrote: As I say, just some thoughts, I *am* curious, Alan, whether you or anyone else on the list are able to help me make this a little more efficient: cur.execute(SELECT short_url,long_url FROM short_urls) giant_list =

Re: [Tutor] Overriding a method in a class

2011-05-13 Thread Terry Carroll
On Fri, 13 May 2011, David Knupp wrote: I think the problem is this bit about overriding an object's internal method with one that is defined externally. Yes, that describes the phenomenon. My gut feeilng is that you'd now have to explicitly pass the object (i.e., self) as well as the

Re: [Tutor] Help with exceptions please

2011-05-13 Thread Wayne Werner
On Fri, May 13, 2011 at 7:48 PM, Lea Parker lea-par...@bigpond.com wrote: Hello I have another assignment I am trying to fine tune. The idea is to make sure exceptions work. I have come up with a problem when testing my code. When I enter a golf score for a player the program returns the

Re: [Tutor] Overriding a method in a class

2011-05-13 Thread Terry Carroll
On Fri, 13 May 2011, Terry Carroll wrote: For my specific case, I'm going to go with a Plan B of using callbacks; and provide default unbound callbacks present in the module, but not defined in the class itself. Here's a callback-with-default approach, which works: ### Thing.py

Re: [Tutor] short url processor

2011-05-13 Thread Nick Raptis
On 05/14/2011 03:49 AM, ian douglas wrote: for i in giant_list: if i[0]: if i[1]: mc.set(i[0], i[1]) Until Alan comes with a more round answer, I'd suggest something along the

[Tutor] Fixed help with exceptions (Lea Parker)

2011-05-13 Thread Lea Parker
-- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tutor/attachments/20110513/b45aa5f8/attach ment-0001.html -- Message: 2 Date: Sat, 14 May 2011 10:48:51 +1000 From: Lea Parker lea-par...@bigpond.com To: tutor@python.org Subject: [Tutor] Help