Re: [Tutor] e-learning Python

2006-09-28 Thread Andrei
Paulino sapo.pt> writes: > Yes I'm looking for something more interactive, but didn't find > anything yet. > Lerning by one's self has it's limitations... I don't know of any such course. Probably the closest thing to it is picking a tutorial, work through it on your own and ask on this list whe

Re: [Tutor] getting 'pwd' for XP ?

2006-09-28 Thread Shantanoo Mahajan
+++ Shantanoo Mahajan [28-09-06 21:12 +0530]: | +++ Dave S [28-09-06 16:10 +0100]: | | I currently running XP (like a fish out of water :) and I need to know the dir | | that the python script is executed from. a linux 'pwd' How can I achieve | | this - I have looked in sys & os & os.path but fo

Re: [Tutor] 2.5's new conditional expression syntax

2006-09-28 Thread wesley chun
> That's very clear. Thanks, Wesley. > And if you wanted to know which is smaller, x or y: > > x = 8**9 > y = 9**8 > smaller = "x" if x < y else "y" > print smaller, "is smaller" > > I think I'm getting the hang of it! your example is correct. if you had a background in C programming, you would r

Re: [Tutor] revisiting struct module

2006-09-28 Thread Luke Paireepinart
shawn bright wrote: > Luke ! > > That worked ! > Man, if you knew how i have pulled my hair out over this for a while. Well, I don't know how your experience in particular has been, but I know I've had moments like that quite often. That's what the tutor list is for :) > I did not wind up usi

Re: [Tutor] revisiting struct module

2006-09-28 Thread shawn bright
Luke ! That worked ! Man, if you knew how i have pulled my hair out over this for a while. I did not wind up using the struct at all. I really thought that I was supposed to, but once i made the message with ord. Like ord(0)+ord(0)+ord(0)+ord(200)... it worked. So i guess this means that it does

Re: [Tutor] revisiting struct module

2006-09-28 Thread Luke Paireepinart
shawn bright wrote: > Hey there, > I am writing this because there is something that I am not > understanding about the struct module. Okay, let's see what we can do. > I have to send a message over a socket. The message has to be exactly > 4 bytes, and the last bit has to be the value of 200. Ok

Re: [Tutor] e-learning Python

2006-09-28 Thread Paulino
Yes I'm looking for something more interactive, but didn't find anything yet. Lerning by one's self has it's limitations... [EMAIL PROTECTED] escreveu: Message: 1 Date: Tue, 26 Sep 2006 10:05:56 + (UTC) From: Andrei <[EMAIL PROTECTED]> Subject: Re: [Tutor] e-learning Python To: tu

Re: [Tutor] 2.5's new conditional expression syntax

2006-09-28 Thread Dick Moores
At 03:25 PM 9/28/2006, wesley chun wrote: >On 9/28/06, Dick Moores <[EMAIL PROTECTED]> wrote: >>I've been looking hard at 2.5's new conditional expression syntax >>(), and didn't >>understand the examples there... >> : >>But it would help to see an

Re: [Tutor] 2.5's new conditional expression syntax

2006-09-28 Thread wesley chun
On 9/28/06, Dick Moores <[EMAIL PROTECTED]> wrote: > I've been looking hard at 2.5's new conditional expression syntax > (), and didn't > understand the examples there... > : > But it would help to see an example I could understand that also > shows

Re: [Tutor] importing module with non-standard name

2006-09-28 Thread Tiago Saboga
Em Quarta 27 Setembro 2006 14:51, Kent Johnson escreveu: > Tiago Saboga wrote: > > Hi! > > > > I'm still playing with man pages parsing, and following advices here, I'm > > using doclifter. But I want to use the installed version on my debian > > system, and not make it a part of my package. The pr

Re: [Tutor] How to get at the list that set() seems to produce?

2006-09-28 Thread Dick Moores
At 11:55 AM 9/28/2006, Kent Johnson wrote: >Dick Moores wrote: > > I'm very interested in the data type, set. > > > > Python 2.5: > > >>> lst = [9,23,45,9,45,78,23,78] > > >>> set(lst) > > set([9, 45, 78, 23]) > > >>> s = "etywtqyertwytqywetrtwyetrqywetry" > > >>> set(s) > > set(['e', 'q', 'r',

Re: [Tutor] How to get at the list that set() seems to produce?

2006-09-28 Thread Danny Yoo
> I'm wondering if there isn't a way to get at what seems to be the > list of unique elements set() seems to produce. Here you go: # >>> list(set(['e', 'q', 'r', 't', 'w', 'y'])) ['e', 'q', 'r', 't', 'w', 'y'] ###

Re: [Tutor] 2.5's new conditional expression syntax

2006-09-28 Thread Dick Moores
Kent, Your examples took a lot of study, but I think I'm catching on. Thanks very much. Dick At 10:53 AM 9/28/2006, Kent Johnson wrote: >Dick Moores wrote: > > I've been looking hard at 2.5's new conditional expression syntax > > (), and didn't > >

Re: [Tutor] How to get at the list that set() seems to produce?

2006-09-28 Thread Kent Johnson
Dick Moores wrote: > I'm very interested in the data type, set. > > Python 2.5: > >>> lst = [9,23,45,9,45,78,23,78] > >>> set(lst) > set([9, 45, 78, 23]) > >>> s = "etywtqyertwytqywetrtwyetrqywetry" > >>> set(s) > set(['e', 'q', 'r', 't', 'w', 'y']) > >>> > > I'm wondering if there isn't a w

[Tutor] revisiting struct module

2006-09-28 Thread shawn bright
Hey there,I am writing this because there is something that I am not understanding about the struct module.I have to send a message over a socket. The message has to be exactly 4 bytes, and the last bit has to be the value of 200. so like this:null,null,null,200 would be the message, and the 200 ha

[Tutor] How to get at the list that set() seems to produce?

2006-09-28 Thread Dick Moores
I'm very interested in the data type, set. Python 2.5: >>> lst = [9,23,45,9,45,78,23,78] >>> set(lst) set([9, 45, 78, 23]) >>> s = "etywtqyertwytqywetrtwyetrqywetry" >>> set(s) set(['e', 'q', 'r', 't', 'w', 'y']) >>> I'm wondering if there isn't a way to get at what seems to be the list of

Re: [Tutor] getting 'pwd' for XP ?

2006-09-28 Thread Dave S
On Thursday 28 September 2006 16:42, Shantanoo Mahajan wrote: > +++ Dave S [28-09-06 16:10 +0100]: > | I currently running XP (like a fish out of water :) and I need to know > | the dir that the python script is executed from. a linux 'pwd' How can I > | achieve this - I have looked in sys & os & o

Re: [Tutor] 2.5's new conditional expression syntax

2006-09-28 Thread Kent Johnson
Dick Moores wrote: > I've been looking hard at 2.5's new conditional expression syntax > (), and didn't > understand the examples there, so I tried making up my own: > > >>> x = (1 if 2 == 2 else 3) > >>> x > 1 > >>> y = (1 if 2 == 1 else 3) > >>

[Tutor] 2.5's new conditional expression syntax

2006-09-28 Thread Dick Moores
I've been looking hard at 2.5's new conditional expression syntax (), and didn't understand the examples there, so I tried making up my own: >>> x = (1 if 2 == 2 else 3) >>> x 1 >>> y = (1 if 2 == 1 else 3) >>> y 3 >>> But it would help to see

Re: [Tutor] getting 'pwd' for XP ?

2006-09-28 Thread Shantanoo Mahajan
+++ Dave S [28-09-06 16:10 +0100]: | I currently running XP (like a fish out of water :) and I need to know the dir | that the python script is executed from. a linux 'pwd' How can I achieve | this - I have looked in sys & os & os.path but found nothing suitable Python 2.4.

Re: [Tutor] getting 'pwd' for XP ?

2006-09-28 Thread David Rock
* Dave S <[EMAIL PROTECTED]> [2006-09-28 16:10]: > I currently running XP (like a fish out of water :) and I need to know the > dir > that the python script is executed from. a linux 'pwd' How can I achieve > this - I have looked in sys & os & os.path but found nothing suitable os.getcwd() http

[Tutor] getting 'pwd' for XP ?

2006-09-28 Thread Dave S
I currently running XP (like a fish out of water :) and I need to know the dir that the python script is executed from. a linux 'pwd' How can I achieve this - I have looked in sys & os & os.path but found nothing suitable Dave ___ Tutor maillist - Tu

Re: [Tutor] file open (take 2)

2006-09-28 Thread Dave S
On Wednesday 27 September 2006 21:59, Dave S wrote: > Hi, > > I am trying to read in an ascii text file, do some alterations and write it > back. > > file = open(self.config.get('pdf','cert') + '/cert.pdf' , 'r+') > lines = file.readlines() > > ... process lines ... > > file.writelines(lines) > fil

[Tutor] Hi, need help on terminal input

2006-09-28 Thread Ramakrishnan, Shashikanth
Hi, Does anybody know how to create a pygtk widget which can accept and diplay input from a serial port?   Thanks and Rgds, Shashikanth Ramakrishnan Embedded Product Division Cell: +6-0122977087 e-mail :[EMAIL PROTECTED]   ___ Tutor