Re: [Tutor] Alice_in_wonderland Question

2014-05-05 Thread Jake Blank
Hi, I finally got it. This was the code: for k in sorted(word_count, key=lambda x:word_count[x], reverse=True): print (k, word_count[k]) The only question i have now is how to limit the amount of returns the program runs to the first 15 results. On Sun, May 4, 2014 at 10:19 PM

Re: [Tutor] Alice_in_wonderland Question

2014-05-05 Thread Jake Blank
To figure that last part out I just did a simple if statement. for k in sorted(word_count, key=lambda x:word_count[x], reverse=True): if word_count[k] >=300: print (k, word_count[k]) And the output was correct. I did have one more question though. import os from wordtools

Re: [Tutor] sending email via SMTP: code review requested

2014-05-05 Thread Japhy Bartlett
The "from" quirk is because it gets parsed as a header, I think. Sending is pretty simple, you should be OK. It may be worth setting up an outgoing-only mail server like postfix that only listens in localhost, gmail can be fussy about quotas. On Sunday, May 4, 2014, Brian van den Broek wrote:

Re: [Tutor] Stephen Mik-Novice Python Programmer(Version 3.4.0)Can't get help using Dictionaries, Lists to 'Hangman Game Problem"

2014-05-05 Thread Walter Prins
Hi Stephen, Please see below: On 5 May 2014 00:17, Stephen Mik wrote: > Dear Python World: > I am almost brand new to Python 3.4.0 and am taking a beginning Python > Programming class at the nearby Community College. One major problem I have > is time management with beginning pseudo code an

Re: [Tutor] Stephen Mik-Novice Python Programmer(Version 3.4.0)Can't get help using Dictionaries, Lists to 'Hangman Game Problem"

2014-05-05 Thread C Smith
Stephen, respond to the list so someone with more experience can help you. I am still learning a lot about Python, but when over-generalized questions are asked, I can tell that more experienced tutor-members will not be able to help you much unless you can learn to frame the questions correctly. Y

Re: [Tutor] Stephen Mik-Novice Python Programmer(Version 3.4.0)Can't get help using Dictionaries, Lists to 'Hangman Game Problem"

2014-05-05 Thread Steven D'Aprano
On Sun, May 04, 2014 at 04:17:57PM -0700, Stephen Mik wrote: > Any thoughts out there about > how to implement the Loops and Data Structures into a "Hangman Game" > programming problem? Yes. Consider the basic structure of a single game: Guess a letter. Is it correct? Do something. Otherwise

Re: [Tutor] sending email via SMTP: code review requested

2014-05-05 Thread Steven D'Aprano
On Sun, May 04, 2014 at 07:00:24PM -0400, Brian van den Broek wrote: > Hi all, > > I am playing with the smtp and email modules from the standard library > of Python 2.7.3 (I also want it to run on 2.6.6). I've not found the > going easy; the SMTP and RFC 2822 standards are not ones I have worked

Re: [Tutor] Stephen Mik-Novice Python Programmer(Version 3.4.0)Can't get help using Dictionaries, Lists to 'Hangman Game Problem"

2014-05-05 Thread Walter Prins
Hi Stephen, Firstly 2 requests: 1) Please do not respond to me personally; instead when interacting with a mailing list please use "reply-all", removing me (or other individuals) from the recipient list. You can also use "reply-list" if your mail program has that option. There are several reaso

Re: [Tutor] sending email via SMTP: code review requested

2014-05-05 Thread Brian van den Broek
On 5 May 2014 13:53, Steven D'Aprano wrote: > On Sun, May 04, 2014 at 07:00:24PM -0400, Brian van den Broek wrote: >> Hi all, >> >> I am playing with the smtp and email modules from the standard library >> of Python 2.7.3 (I also want it to run on 2.6.6). I've not found the >> going easy; the SMTP

Re: [Tutor] sending email via SMTP: code review requested

2014-05-05 Thread Japhy Bartlett
If you get deeper into processing emails, you might check out http://lamsonproject.org/ . I wasn't fond of the whole thing, but if you dig into the src there is some pretty good code for handling malformed MIME structures and unicode issues in a sane way. On Mon, May 5, 2014 at 4:26 PM, Brian va

Re: [Tutor] Final review

2014-05-05 Thread Scott W Dunning
On May 1, 2014, at 5:30 AM, Steven D'Aprano wrote: Awesome, thanks everyone! I understand lists a lot better now. I have another question. I don’t understand why below would give an error? >>> greeting = 'Hello World’ >>> greeting [len(greeting)] _

Re: [Tutor] Final review

2014-05-05 Thread meenu ravi
Hi Scott, The variable greeting is of type "string". >>> greeting = "Hello world" >>> type(greeting) The len(string) will count each character in the value of variable "greeting" starting from '1'. H - 1 e - 2 l - 3 l - 4 0 - 5 space - 6(Space and special characters are also counted)