Re: [Tutor] [tutor] threading problem in GUI

2005-09-08 Thread Pierre Barbier de Reuille
Great :) Just to be clear about that: you can see the "connect" line as a dynamic registration process (with the symetric disconnect operation available via ... "disconnect"). The only thing you need is to connect (at runtime) the even before it's called (obvious isn't it ? ;) ), but you have no o

[Tutor] Emulate jetdirect

2005-09-08 Thread János Juhász
Hi All, I just would make some kind of printer filter for an HP printer, that is connected to a jetdirect printserver. The functionality is something like this: netcat -l -p 9100 | filter.py | netcat 10.36.11.11 9100 I would like to make it as a simple socketserver in python for the port 9100, r

Re: [Tutor] [tutor] threading problem in GUI

2005-09-08 Thread nephish
Pierre Barbier de Reuille wrote: >Great :) > >Just to be clear about that: you can see the "connect" line as a dynamic >registration process (with the symetric disconnect operation available >via ... "disconnect"). The only thing you need is to connect (at >runtime) the even before it's called (ob

[Tutor] python strings?

2005-09-08 Thread andrade1
below is my program. what i would like to do is to get the last line to print the number of years that the user enters and also the principal # A program to compute the value of an investment # years into the future def main(): print "This program calculates the future value of an investme

Re: [Tutor] Making Applets

2005-09-08 Thread kim.d
Alan G. wrote: <<>> <<>> Thanks, Alan. I'll give it a look. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] input/output redirection

2005-09-08 Thread Lane, Frank L
Title: Message Hi List,   I wanted to take the stdout of a process and redirect it to stdin of a python script, then after playing with the input in the script I want to send it back to stdout (all of this to be done while the original process runs happily along).  I can't seem to figure ou

Re: [Tutor] input/output redirection

2005-09-08 Thread Javier Ruere
Lane, Frank L wrote: > Hi List, > > I wanted to take the stdout of a process and redirect it to stdin of a > python script, then after playing with the input in the script I want to > send it back to stdout (all of this to be done while the original > process runs happily along). I can't seem to

Re: [Tutor] python strings?

2005-09-08 Thread Daniel Watkins
On Thu, 2005-09-08 at 15:15 +0100, [EMAIL PROTECTED] wrote: > for i in range(10): > principal = principal * (1 + apr) To calculate compound interest, you in fact don't need to use a loop at all (you could use: 'final = principal * (apr ** years)') but if you really want to use a loop,

Re: [Tutor] input/output redirection

2005-09-08 Thread Danny Yoo
On Thu, 8 Sep 2005, Lane, Frank L wrote: > I wanted to take the stdout of a process and redirect it to stdin of a > python script, then after playing with the input in the script I want to > send it back to stdout (all of this to be done while the original > process runs happily along). I can't

[Tutor] Substring substitution

2005-09-08 Thread Bernard Lebel
Hello, I have a string, and I use a regular expression to search a match in it. When I find one, I would like to break down the string, using the matched part of it, to be able to perform some formatting and to later build a brand new string with the separate parts. The regular expression part wo

Re: [Tutor] input/output redirection

2005-09-08 Thread David Rock
* Lane, Frank L <[EMAIL PROTECTED]> [2005-09-08 09:49]: > Hi List, > > I wanted to take the stdout of a process and redirect it to stdin of a > python script, then after playing with the input in the script I want to > send it back to stdout (all of this to be done while the original > process ru

Re: [Tutor] Substring substitution

2005-09-08 Thread Kent Johnson
Bernard Lebel wrote: > Hello, > > I have a string, and I use a regular expression to search a match in > it. When I find one, I would like to break down the string, using the > matched part of it, to be able to perform some formatting and to later > build a brand new string with the separate parts

Re: [Tutor] python strings?

2005-09-08 Thread Alan G
>> print "The value in years is", principal > To actually answer your question, in order to print this correctly, > you > need to tell Python to convert the integer (principal) to a string > by > using the built-in function str() like so: Not so. print automatically calls str() on all its a

Re: [Tutor] python strings?

2005-09-08 Thread Daniel Watkins
On Thu, 2005-09-08 at 21:00 +0100, Alan G wrote: > Not so. print automatically calls str() on all its arguments so > the programmer doesn't need to. So it does. I think I was trying to concatenate, which it doesn't like. Sorry if I caused any confusion. Dan ___

Re: [Tutor] Substring substitution

2005-09-08 Thread Bernard Lebel
Hi Kent, This is nice! There is one thing though. When I run the oRe.sub() call, I get an error: Traceback (most recent call last): File "", line 1, in ? File "\\Linuxserver\prod\XSI\WORKGROUP_4.0\Data\Scripts\pipeline\filesystem\bb_processshotdigits.py", line 63, in ? processPath( r'C

Re: [Tutor] python strings?

2005-09-08 Thread Oliver Maunder
On 08/09/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: below is my program. what i would like to do is to get the last line toprint the number of years that the user enters and also the principal There are a couple (at least!) of ways to get the values into the string that you print. The first

Re: [Tutor] Substring substitution

2005-09-08 Thread Bernard Lebel
Ok I think I understand what is going: I'm using a 0 in the replacement argument, between the two groups. If I try with a letter or other types of characters it works fine. So how can use a digit here? Thanks Bernard On 9/8/05, Bernard Lebel <[EMAIL PROTECTED]> wrote: > Hi Kent, > > This is nic

Re: [Tutor] Substring substitution

2005-09-08 Thread Kent Johnson
Bernard Lebel wrote: > Ok I think I understand what is going: I'm using a 0 in the > replacement argument, between the two groups. If I try with a letter > or other types of characters it works fine. So how can use a digit > here? There is a longer syntax for \1 - \g<1> means the same thing but wi

[Tutor] making a table

2005-09-08 Thread Goofball223
I would like to construct a table for my program but it does not seem to be coming out evenly. Could someone please let me know what to do so that everything will work out correctly? def main():    print "This program shows a table of Celsius temperatures and there Fahrenheit equivalents every 10

Re: [Tutor] making a table

2005-09-08 Thread Danny Yoo
On Thu, 8 Sep 2005 [EMAIL PROTECTED] wrote: > I would like to construct a table for my program but it does not seem to > be coming out evenly. Could someone please let me know what to do so > that everything will work out correctly? Hello, I'll assume for the moment that you want, in your prin

Re: [Tutor] making a table

2005-09-08 Thread bob
At 04:34 PM 9/8/2005, [EMAIL PROTECTED] wrote: I would like to construct a table for my program but it does not seem to be coming out evenly. Could someone please let me know what to do so that everything will work out correctly? def main():    print "This program shows a table of Celsius tempe