Re: [Tutor] Python Book recomandation!

2010-07-16 Thread Ethan Wei
For BOOK recommend:my favor. :) For promote you skill: Find a short python source code(ex.from open source project) and read it. you can learn more useful programing methods. 2010/7/16 Alan Gauld > > "Daniel" wrote > > Python website, but I have a question regarding it. With what book I

Re: [Tutor] I don't understand this code

2010-07-16 Thread ZUXOXUS
Hey, thanks for your help! I couldn't understand because I didn't see that further down in the code, as Serdar Tumgoren said, the function was called: secretWord = getRandomWord(words) without that line I couldn't get it. Thank you very much, everybody, great explanations. Alan, I have been c

[Tutor] Removing GB pound symbols from Beautiful soup output

2010-07-16 Thread Andy
Dear Nice people I've been using beautiful soup to filter the BBC's rss feed. However, recently the bbc have changed the feed and it is causing me problems with the pound(money) symbol. The initial error was "UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3'" which means that th

Re: [Tutor] Removing GB pound symbols from Beautiful soup output

2010-07-16 Thread Ethan Wei
1st. what's the BBC's rss page coding? UTF-8 or something. 2nd. confirm you file coding and document coding equate rss page coding. 3rd. add fromEncoding to you BeautifulSoup instance。 > ex. soup = BeautifulSoup(html,fromEncoding="utf-8") > 2010/7/16 Andy > Dear Nice people > > I've been usin

Re: [Tutor] append, list and variables

2010-07-16 Thread Mary Morris
Thanks-that helps a lot. The only question I have about your pseudocode is what the 'initialize result container' does. I'm pretty new to python and scripting in general so I'm still trying to figure everything out. On Thu, Jul 15, 2010 at 12:58 PM, Emile van Sebille wrote: > On 7/15/2010 11:32

Re: [Tutor] append, list and variables

2010-07-16 Thread Emile van Sebille
On 7/16/2010 8:37 AM Mary Morris said... Thanks-that helps a lot. The only question I have about your pseudocode is what the 'initialize result container' does. I'm pretty new to python and scripting in general so I'm still trying to figure everything out. It creates an empty data storage cont

Re: [Tutor] append, list and variables

2010-07-16 Thread pk
Dnia 16-07-2010 o 19:54:01 Emile van Sebille napisał(a):> On 7/16/2010 8:37 AM Mary Morris said...>> Thanks-that helps a lot.>> The only question I have about your pseudocode is what the 'initialize>> result container' does. I'm pretty new to python and scripting in >> general>> so I'm still

Re: [Tutor] append, list and variables

2010-07-16 Thread Steven D'Aprano
On Sat, 17 Jul 2010 05:44:07 am pk wrote: > In general, the shorter and more descriptive a variable name is, > the better. That's a generalisation that is contradictory. Short works against descriptive. Compare: n # nice and short number_of_widgets_ordered # nice and descriptive, if a bit wo

[Tutor] now = ctime()[11:20]

2010-07-16 Thread Richard D. Moores
Please see Foolishly, without thinking it through, I expected the 2 prints to show different times. I understood right away why they were identical, but then I began to wonder how to create an "alias" for "ctime()[11:20]" so I wouldn't have to keep typing or