Re: [Edu-sig] project Euler
2009/2/13 kirby urner kirby.ur...@gmail.com: Sum of multiples of three (3-999), plus multiples of five (5-995), minus multiples of 15 (15-990). No programming required. Getting this as one line in Python would be a fun challenge though. Maybe. However, considering their educational value, I think the problems are unmotivated and the result of doing any problem is almost useless. I think newcomers to programming find externally-motivated problems more compelling, especially when the solution is elegant and not bogged down in housekeeping or corner cases. -Steven Bird ___ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
[Edu-sig] Python and Linguistics
The Natural Language Toolkit is a Python library supporting the linguistic analysis of text. It comes with an online book that teaches Python, Linguistics and Natural Language Processing. It includes material that is suitable for secondary, undergraduate, and graduate levels. Version 0.9.7 has just been released, and is available at http://www.nltk.org/ -Steven Bird http://www.csse.unimelb.edu.au/~sb/ ___ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
Re: [Edu-sig] Introducing Python to Engineering Students
We're considering this book for adoption in a second year programming course for Engineers: Numerical Methods in Engineering with Python by Jaan Kiusalaas http://www.amazon.com/Numerical-Methods-Engineering-Python-Kiusalaas/dp/0521852870 Steven Bird http://www.csse.unimelb.edu.au/~sb/ On 3/11/08, Warren Sande [EMAIL PROTECTED] wrote: David, For output graphics, you might want to have a look at Pygame. It is a wrapper for the SDL library. It has functionality for creating graphics windows, drawing, sprites, etc. But what might be of interest for you is the simple set_at(x,y) method, to set the color of individual pixels in a window. I have found the Pygame documentation to be pretty good. Here is a simple example of plotting a sinewave using set_at() #- import pygame, sys, math screen = pygame.display.set_mode([640,480]) for x in range(0, 640): y = int(math.sin(x/640.0 * 4 * math.pi) * 200 + 240) screen.set_at([x, y],[255,0,0]) pygame.display.flip() while True: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() #-- Warren Sande - Original Message From: David MacQuigg [EMAIL PROTECTED] To: edu-sig@python.org Sent: Monday, March 10, 2008 10:28:21 PM Subject: [Edu-sig] Introducing Python to Engineering Students I've been asked to give an intro to Python for a freshman class with 150 students at University of Arizona. The class is taught in the Electrical and Computer Engineering Department, and is titled Computer Programming for Engineering Applications. The language is C (Hanly Koffman, Problem Solving and Program Design in C). I think a nice way to do this will be an application where we can show the advantages of both languages - the computation of Mandelbrot images http://en.wikipedia.org/wiki/Mandelbrot_set. Python will provide the high-level glue which brings everything together in a nice programming environment, and C will provide the raw power for the loop that actually computes the pixels. My initial tests show this loop running about 100 times faster in C than in Python. The challenge is to do this without overwhelming the students. The plan is to make everything as simple as possible, just follow the instructions, except the loop itself, which the students will write in C, based on what I have written in Python. See http://ece.arizona.edu/~edatools/ece175/projects/mandelbrots/mbrotHW.html. Suggestions are welcome. Has anyone done something like this before? Can you improve on my code (I'm not a Python expert), or even suggest something entirely different? There is one major piece I would like to add to what I have so far - output graphics. This demo would really be cool if the students could see these glorious images appear on their screen instead of an array of numbers. I looked at the Python Imaging Library http://www.pythonware.com/products/pil/index.htm, and I don't see any examples that I can work from in converting an array of numbers into an image, just a lot of dense reference material that assumes I already know these image data formats. Maybe there is a simpler way. Help from someone with experience in Python graphics would be most appreciated. -- Dave ___ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig ___ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig ___ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
[Edu-sig] Python for Natural Language Processing
NLTK-Lite version 0.9 has been released -- http://nltk.org/index.php NLTK -- the Natural Language Toolkit -- is a suite of open source Python modules, data and documentation for research and development in natural language processing. NLTK contains code supporting dozens of NLP tasks, along with 30 popular corpora and extensive documentation including a 360-page online book. Distributions for Windows, Mac OSX and Linux are available. The toolkit has been used in 50+ university courses in over 15 countries, and is in the top 0.1% of SourceForge projects (32,000 downloads in the past 12 months). Contents: NLTK consists of over 50k lines of Python code and 480Mb of data: Corpora: Treebanks (English, Chinese, Dutch, Catalan, Spanish, Portuguese); POS-tagged corpora including the Brown Corpus; text corpora; PP attachment, named entity, WSD, TIMIT sample, Chat-80 database, WordNet, CMU Pronunciation Dictionary. Tokenizers: whitespace, newline, blankline, word, wordpunct, treebank, regexp, Punkt sentence segmenter Stemmers: Porter, Lancaster, regexp Taggers: regexp, n-gram, backoff, Brill, HMM Parsers: recursive descent, shift-reduce, chunk, chart, feature-based, probabilistic, ... Semantic interpretation: untyped lambda calculus, first-order models, parser interface Wordnet: wordnet interface, lexical relations, similarity Classifiers: decision tree, maximum entropy, naive Bayes, Weka interface Clusterers: expectation maximization, agglomerative, k-means Evaluation: accuracy, precision, recall, F-measure, windowdiff Estimation: uniform, maximum likelihood, Lidstone, Laplace, expected likelihood, heldout, cross-validation, Good-Turing, Witten-Bell Miscellaneous: feature detection, unification, chatbots, many utilities Changes: Version 0.9 is substantially revised and expanded from version 0.8. The entire toolkit can be accessed via a single import statement import nltk, and there is a more convenient naming scheme. Calling deprecated functions generates messages that help programmers update their code. The corpus, tagger, and classifier modules have been redesigned. All functionality of the old NLTK 1.4.3 is now covered by NLTK-Lite 0.9. The book has been revised and expanded. A new data package incorporates the existing corpus collection and contains new sections for pre-specified grammars and pre-computed models. Several new corpora have been added, including treebanks for Portuguese, Spanish, Catalan and Dutch. A Macintosh distribution is provided. For full details of the changes, please see: http://nltk.svn.sourceforge.net/viewvc/*checkout*/nltk/trunk/nltk/ChangeLog ___ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
Re: [Edu-sig] list newbie
On 5/28/06, Scott David Daniels [EMAIL PROTECTED] wrote: Here's a trick I use for myself when the shell screen gets too full: 1) Make sure another window is open (do File / New Window if needed). 2) Close the shell screen. 3) On (one of) the open window(s) do Windows / Python Shell. You now have a nice clean window. But then you lose the session. You could recover the session by re-entering the necessary lines (e.g. importing modules, defining variables), but that leaves us with the original problem... -Steven Bird ___ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
Re: [Edu-sig] list newbie
On 5/27/06, kirby urner [EMAIL PROTECTED] wrote: On 5/26/06, Kris Olson [EMAIL PROTECTED] wrote: Is there a way to clear the screen or open a new interactive screen? Hey Kris, I know what you mean. Sometimes I roll up the IDLE window so that the bottom of the frame is towards the middle of my screen. But there might be a better solution. I do the same thing, but its clunky and doesn't completely solve the problem. I can think of various solutions in addition to a clear screen button: a) clear history, which leaves the interactive prompt at the top of the window b) a scrollbar which lets you scroll down so that the only line shown is at the very top of the window -Steven Bird ___ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig