Re: [Tutor] How to get terminal settings

2006-01-20 Thread Vincent Zee
On Thursday, 19 January 2006 at 16:03:16 -0800, Terry Carroll wrote: > On Thu, 19 Jan 2006, Vincent Zee wrote: > > > Any pointers to other curses howto's? > > There's http://heather.cs.ucdavis.edu/~matloff/Python/PyCurses.pdf ; but > it's mostly a couple of example programs, without a lot of exp

Re: [Tutor] glibc error while Python script runs - Solved

2006-01-20 Thread Kent Johnson
Bernard Lebel wrote: > On 1/19/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > >>Hi Bernard, >> >>I'm glad you got it working but kind of surprised at what you had to do. >>You shouldn't have to have a single thread to access the database. In >>your original desing were you sharing a connection betw

Re: [Tutor] Simple MS Windows Shell Extension?

2006-01-20 Thread Alan Gauld
> I have a python script that I want my users to execute with a > "Right-Mouse-Click" on a file under Windows XP. > > (If possible without changing the default "Open with ..." behavior from > Windows.) Use Windows explorer to edit the options on that file type. You can add new context menu items

Re: [Tutor] How to get terminal settings

2006-01-20 Thread Vincent Zee
On Thursday, 19 January 2006 at 23:53:06 -, Alan Gauld wrote: > Assuming you are on a Unix style OS/terminal you can read the > output of stty. Look at the rows value > > Here are a couple of runs of rows at different terminal sizes: > > $ stty -a | grep rows > speed 38400 baud; rows 41; col

[Tutor] unittest and private methods

2006-01-20 Thread lemeia
I currently have a class where I have quite a few private methods. One of these methods is a small general utility that extracts characters from provided text up until it reaches a delimiter. Something like extractTo(self, text, delimiter). It's not a relevant interface to the class, just a uti

Re: [Tutor] unittest and private methods

2006-01-20 Thread Kent Johnson
lemeia wrote: > I currently have a class where I have quite a few private methods. > One of these methods is a small general utility that extracts characters from provided text up until it reaches a delimiter. Something like extractTo(self, text, delimiter). > > It's not a relevant interface to th

Re: [Tutor] glibc error while Python script runs - Solved

2006-01-20 Thread Bernard Lebel
Hi Danny, So have written a little test script. The fact is that I want to be able to manage the same queue from separate threads. Below is an example of what my real program is doing: from threading import Thread from Queue import Queue import time class SQLServer: def __init

[Tutor] Quoting trouble

2006-01-20 Thread Marilyn Davis
Dear Tutors, I'm having a problem and going around in circles. I'm on Python 2.4.1. This odd address line comes in email: >>> line = '''"ma >> \"[EMAIL PROTECTED]"" <[EMAIL PROTECTED]>''' It makes sense to me, and to the MTA. I want to use it to create a variable: >>> exec('h_to = %s' % li

[Tutor] Starbucks does not use two-phase commit

2006-01-20 Thread Danny Yoo
On Fri, 20 Jan 2006, Bernard Lebel wrote: > So have written a little test script. The fact is that I want to be able > to manage the same queue from separate threads. Below is an example of > what my real program is doing: Hi Bernard, One problem is that there's a single outputQueue being pre

Re: [Tutor] Quoting trouble

2006-01-20 Thread Kent Johnson
Marilyn Davis wrote: > Dear Tutors, > > I'm having a problem and going around in circles. I'm on Python 2.4.1. > > This odd address line comes in email: > > line = '''"ma >> \"[EMAIL PROTECTED]"" <[EMAIL PROTECTED]>''' > > > It makes sense to me, and to the MTA. I want to use it to cr

Re: [Tutor] Quoting trouble

2006-01-20 Thread Marilyn Davis
On Fri, 20 Jan 2006, Kent Johnson wrote: Thank you so much Kent. This is *very* helpful. > Marilyn Davis wrote: > > Dear Tutors, > > > > I'm having a problem and going around in circles. I'm on Python 2.4.1. > > > > This odd address line comes in email: > > > > > line = '''"ma >> \"[E

Re: [Tutor] Quoting trouble

2006-01-20 Thread Python
On Fri, 2006-01-20 at 13:50 -0800, Marilyn Davis wrote: > for each in significant_headers.keys(): > this = '''self.h_%s = "%s"''' % \ >(each[:-2].lower().replace('-','_'), > repr(significant_headers[each])) > exec(this) So you

Re: [Tutor] Quoting trouble

2006-01-20 Thread Marilyn Davis
On Fri, 20 Jan 2006, Python wrote: > On Fri, 2006-01-20 at 13:50 -0800, Marilyn Davis wrote: > > for each in significant_headers.keys(): > > this = '''self.h_%s = "%s"''' % \ > >(each[:-2].lower().replace('-','_'), > > repr(significant_he

Re: [Tutor] Quoting trouble

2006-01-20 Thread Kent Johnson
Marilyn Davis wrote: > significant_headers[each] = > text[len(each):].strip().replace('"','\\"').replace('\n',' ') This looks like you are trying to make an escaped string, with literal backslashes. You might prefer using the 'string_escape' codec: >>> '\n'.encode('string_escape') '\\n' Kent

[Tutor] Doubt with classes

2006-01-20 Thread Edgar Antonio Rodríguez Velazco
Hi everybody, I've been reading the chapter of classes of Byte of Python by Swaroop. There's an example with classes (11.4) that is below:   # class Person:'''Represents a person.'''population = 0 def __init__(self, name):'''Initializes the person's data.

Re: [Tutor] Doubt with classes

2006-01-20 Thread Kent Johnson
Edgar Antonio Rodríguez Velazco wrote: > Hi everybody, > I've been reading the chapter of classes of Byte of Python by Swaroop. > There's an example with classes (11.4) that is below: The example is depending on Person.__del__() being called on swaroop and kalam when the intepreter exits. The Py

[Tutor] python-based system programming and admin?

2006-01-20 Thread Neal McBurnett
I'm an experienced linux guy, with lots of python interest and some python experience. I'm helping a colleague develop software to run on our linux server. He has python skill, but doesn't know the shell or linux very well at all. I'd like to give him a secure, safe, flexible development environm

[Tutor] Is this overkill?

2006-01-20 Thread Bradly McConnell
Greetings all: I'm new to Python, and have come across and exercise that basically counts to 100. The idea is to accept user input for an initial number, and then let the user add additional numbers. I wanted to give feedback if a number selected would bring the total above 100, so the user woul

Re: [Tutor] unittest and private methods

2006-01-20 Thread lemeia
kent wrote: > > I currently have a class where I have quite a few private methods. > > One > of these methods is a small general utility that extracts characters > from provided text up until it reaches a delimiter. Something like > extractTo(self, text, delimiter). > > > > It's not a relevant int