Re: [Tutor] Efficiency

2011-06-25 Thread Steven D'Aprano
Hello Naheed, You seem to have messed up your quoting. Text starting with a > is a quote, but in your reply, you have written text starting with > as if it were written by me. I have fixed the quoting in this reply, but please try to watch that. See below for more comments. naheed arafat w

Re: [Tutor] Efficiency

2011-06-25 Thread naheed arafat
On Sat, Jun 25, 2011 at 9:42 PM, Steven D'Aprano wrote: > naheed arafat wrote: > >> 1) >> >>> zip('How are you?'.split(' ')[::-1],'i am fine.'.split(' ')) > [('you?', 'i'), ('are', 'am'), ('How', 'fine.')] >> >>> map(lambda i,j:(i,j),'How are you?'.split(' ')[::-1],'i am > fine.'

Re: [Tutor] Efficiency

2011-06-25 Thread naheed arafat
On Sat, Jun 25, 2011 at 9:38 PM, Alan Gauld wrote: > > "naheed arafat" wrote > > 1) >> >>> zip('How are you?'.split(' ')[::-1],'i am fine.'.split(' ')) > [('you?', 'i'), ('are', 'am'), ('How', 'fine.')] >> >>> map(lambda i,j:(i,j),'How are you?'.split(' ')[::-1],'i am > fine.'.

Re: [Tutor] Television

2011-06-25 Thread Vincent Balmori
It's working better now. The problem I have left is that I have to set the channel and volume values in a range (for both I intend for 0-10). I thought the range() would be the choice, but probably I'm not using it right. Another one is for the tv.channel to hold a new value instead of just adding

Re: [Tutor] Efficiency

2011-06-25 Thread Peter Otten
naheed arafat wrote: > Is there any way easier to do the following? > input: > 'How are you' > 'I am fine' > output: > 'you I are am How fine' > > solution: ' '.join(reduce(lambda x,y:x+y, zip('How are you'.split(' ')[::-1], > 'I am fine'.split(' ' reversed(items) instead of items[::-1]

Re: [Tutor] BadPickleGet error

2011-06-25 Thread Peter Otten
Rick Pasotto wrote: > Traceback (most recent call last): > File "/usr/share/rss2email/rss2email.py", line 748, in > else: run() > File "/usr/share/rss2email/rss2email.py", line 488, in run > feeds, feedfileObject = load() > File "/usr/share/rss2email/rss2email.py", line 439, in load

Re: [Tutor] Efficiency

2011-06-25 Thread Alexandre Conrad
2011/6/25 naheed arafat : > 1) zip('How are you?'.split(' ')[::-1],'i am fine.'.split(' ')) > [('you?', 'i'), ('are', 'am'), ('How', 'fine.')] map(lambda i,j:(i,j),'How are you?'.split(' ')[::-1],'i am fine.'.split(' ')) > [('you?', 'i'), ('are', 'am'), ('How', 'fine.')] > > Which on

Re: [Tutor] Efficiency

2011-06-25 Thread Steven D'Aprano
naheed arafat wrote: 1) zip('How are you?'.split(' ')[::-1],'i am fine.'.split(' ')) [('you?', 'i'), ('are', 'am'), ('How', 'fine.')] map(lambda i,j:(i,j),'How are you?'.split(' ')[::-1],'i am fine.'.split(' ')) [('you?', 'i'), ('are', 'am'), ('How', 'fine.')] Which one has better efficiency

[Tutor] BadPickleGet error

2011-06-25 Thread Rick Pasotto
Traceback (most recent call last): File "/usr/share/rss2email/rss2email.py", line 748, in else: run() File "/usr/share/rss2email/rss2email.py", line 488, in run feeds, feedfileObject = load() File "/usr/share/rss2email/rss2email.py", line 439, in load feeds = pickle.load(feedfile

Re: [Tutor] Efficiency

2011-06-25 Thread Alan Gauld
"naheed arafat" wrote 1) zip('How are you?'.split(' ')[::-1],'i am fine.'.split(' ')) [('you?', 'i'), ('are', 'am'), ('How', 'fine.')] map(lambda i,j:(i,j),'How are you?'.split(' ')[::-1],'i am fine.'.split(' ')) [('you?', 'i'), ('are', 'am'), ('How', 'fine.')] Which one has better efficie

Re: [Tutor] Conceptual Question About Use of Python for Employee Training Program

2011-06-25 Thread Steven D'Aprano
Adam Carr wrote: Good Morning: I am very new to Python but I am enjoying the learning process. I have a question about the application of Python to a problem at the industrial business where I work. My two main questions are: 1. Can Python be used to achieve the goals of the possible project

Re: [Tutor] Conceptual Question About Use of Python for Employee Training Program

2011-06-25 Thread John Fabiani
On Saturday, June 25, 2011 06:18:14 am Adam Carr wrote: > Good Morning: > > I am very new to Python but I am enjoying the learning process. I have a > question about the application of Python to a problem at the industrial > business where I work. My two main questions are: > > 1. Can Python be u

Re: [Tutor] Conceptual Question About Use of Python for Employee Training Program

2011-06-25 Thread Mac Ryan
Just thought to google for "S5 python", and google came out with a lot of interesting links! :o /mac > Good Morning: > > I am very new to Python but I am enjoying the learning process. I > have a question about the application of Python to a problem at the > industrial business where I work. My

Re: [Tutor] Conceptual Question About Use of Python for Employee Training Program

2011-06-25 Thread Mac Ryan
On Sat, 25 Jun 2011 06:18:14 -0700 (PDT) Adam Carr wrote: > Good Morning: > > I am very new to Python but I am enjoying the learning process. I > have a question about the application of Python to a problem at the > industrial business where I work. My two main questions are: > > 1. Can Python

[Tutor] Conceptual Question About Use of Python for Employee Training Program

2011-06-25 Thread Adam Carr
Good Morning: I am very new to Python but I am enjoying the learning process. I have a question about the application of Python to a problem at the industrial business where I work. My two main questions are: 1. Can Python be used to achieve the goals of the possible project? 2. Where are the

[Tutor] Efficiency

2011-06-25 Thread naheed arafat
1) >>> zip('How are you?'.split(' ')[::-1],'i am fine.'.split(' ')) [('you?', 'i'), ('are', 'am'), ('How', 'fine.')] >>> map(lambda i,j:(i,j),'How are you?'.split(' ')[::-1],'i am fine.'.split(' ')) [('you?', 'i'), ('are', 'am'), ('How', 'fine.')] Which one has better efficiency? 2) Is there any

Re: [Tutor] Television

2011-06-25 Thread Alan Gauld
"Vincent Balmori" wrote Before I can even start correcting my code this error shows up. You will find it much easier to write programns if you do not write out the whole program and then try to debug it! Just write a single method at a time and get that working before trying to debug a whole

Re: [Tutor] Television

2011-06-25 Thread Noah Hall
On Sat, Jun 25, 2011 at 9:18 AM, Vincent Balmori wrote: > > The question for this is to make a program that simulates a TV by creating it > as an object. The user should be able to to enter a channel and or raise a > volume. Make sure that the Channel Number and Volume stay within valid > ranges.

[Tutor] Television

2011-06-25 Thread Vincent Balmori
The question for this is to make a program that simulates a TV by creating it as an object. The user should be able to to enter a channel and or raise a volume. Make sure that the Channel Number and Volume stay within valid ranges. Before I can even start correcting my code this error shows up. I