Re: compare dictionaries

2010-09-07 Thread pdlemper
On Tue, 7 Sep 2010 12:46:36 -0700 (PDT), Baba raoul...@gmail.com wrote: level: beginner word= 'even' dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2} i want to know if word is entirely composed of letters in dict2 my approach: step 1 : convert word to dictionary(dict1) step2: for k in

Python Imaging Library available for Python 3.1 ? Fractals

2010-06-05 Thread pdlemper
On the site http://code.activestate.com/recipes/langs/python/ there are several scripts for fractals. See page five. These begin from PIL import Image This fails in my python 3.1.2 Google reveals PIL is Python Imaging Library from pythonware.com According to their

Re: interactive terminal in Ubuntu Linux : libreadline5-dev works only in Python 2.6 not 3.1

2010-01-09 Thread pdlemper
On Sat, 9 Jan 2010 13:27:07 -0800 (PST), casevh cas...@gmail.com wrote: Did you recompile Python 3.1.1 after installing libreadline5-dev? (From the Python 3.1.1 directory. Your options to configure may vary.) make distclean ./configure --prefix=/usr/local --with-computed-gotos --with-wide-

Python interactive terminal in Ubuntu Linux : some keys fouled up

2010-01-06 Thread pdlemper
Have recently moved from XP to Ubuntu Linux. Successfully installed Python 3.1.1 in the Ubuntu 9.04 release on my desktop. Problem is the python interactive terminal . Many of the keys now do not work. eg pressing left-arrow yields ^[[D right-arrow ^[[C

Apple Mac OS X 10.6 support compatability with Python 3 ?

2009-12-16 Thread pdlemper
I've been given a MAC AIR laptop with OS X 10.6 Snow Leopard. On my desktop I dual boot with XP - Ubuntu and have Python on both. Unfortunately all my Python programs are written on Windows XP and I heavily rely on WConio for console I/O. Called Apple tech support. The technician had never heard

Re: trouble with complex numbers

2009-08-05 Thread pdlemper
On Wed, 05 Aug 2009 08:18:55 -0700, Scott David Daniels scott.dani...@acm.org wrote: I think it explained in the complex math area, but basically EE types use j, math types use i for exactly the same thing. Since i is so frequently and index in CS, and there is another strong convention, why not

gamma approximation : what is module cmath and where is it located ?

2009-07-29 Thread pdlemper
The following numerical approximation for Euler's Gamma function is found in http://en.wikipedia.org/wiki/Lanczos_approximation from cmath import * # Coefficients used by the GNU Scientific Library g = 7 p = [0.80993, 676.5203681218851, -1259.1392167224028, 771.32342877765313,

Re: gamma approximation : what is module cmath and where is it located ?

2009-07-29 Thread pdlemper
On Wed, 29 Jul 2009 21:36:31 -0700 (PDT), Carl Banks pavlovevide...@gmail.com wrote: On Jul 29, 9:24 pm, pdlem...@earthlink.net wrote: What is cmath, where did it come from and how does it differ from the standard math module  ? What happened when you did a keyword search for cmath in the

Can module tell if running from interpreter vs Windows command line ?

2009-07-15 Thread pdlemper
The WConio console module produces different colors, sometimes quite different, when run from Windows command line vs from Python interpreter . A good foregnd/backgnd combination under one may be unreadable under the other : ( I'm using Python 3.0 with the corresponding WConio on XP. Is there

Re: Can module tell if running from interpreter vs Windows command line ?

2009-07-15 Thread pdlemper
On Wed, 15 Jul 2009 19:07:18 -0500, pdlem...@earthlink.net wrote: The WConio console module produces different colors, sometimes quite different, when run from Windows command line vs from Python interpreter . A good foregnd/backgnd combination under one may be unreadable under the other : (

Persistent failure of 'break' statement ( novice )

2009-06-13 Thread pdlemper
Thanks Mark Rhodri. Neither works. I'm using Notepad2 as editor. Don't use the tab. Each space counted with spacebar recounted. Rewrote the block from scratch as new script and eliminated the print line in the loop. Now no error message, but it will go on forever despite repeatedly entering

Re: Persistent failure of 'break' statement ( novice )

2009-06-13 Thread pdlemper
On Sat, 13 Jun 2009 19:03:38 -0700 (PDT), John Machin sjmac...@lexicon.net wrote: On Jun 14, 10:20 am, pdlem...@earthlink.net wrote: Now no error message, but it will go on forever despite repeatedly entering 0.  Have to get out with ctrl-c .                Frusting: I'm missing something

Is it possible to use multidimensional arrays ?

2009-06-06 Thread pdlemper
All attempts have failed. import WConio import array screen = array.array('H',[0]*75,[0]*24) ERR array takes at most 2 arguments screen = array.array('H',[0]*75[0]*24) TypeErr int object is unsubscriptable

Failure of running a second script in same interactive session

2009-04-20 Thread pdlemper
When I open python.exe to the console or interactive window and import/run a script I am frustrated trying to import and run another script in the same session. eg I run the script alphasort once fine : import alphasort it runs When its finished I then try to run the same or

Learning Python : import math doesn't work ?

2007-11-18 Thread pdlemper
Have carefully installed Python 2.5.1 under XP in dir E:\python25 . ran set path = %path% ; E:\python25 Python interactive mode works fine for simple arithmetic . Then tried import math x = sqrt(100) Get errorName error : name 'sqrt' is not defined Same thing