On Tue, 7 Sep 2010 12:46:36 -0700 (PDT), Baba
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 dict1.keys():
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 web
On Sat, 9 Jan 2010 13:27:07 -0800 (PST), casevh
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-
>unicode
>mak
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
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
On Wed, 05 Aug 2009 08:18:55 -0700, Scott David Daniels
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 let the EE types
On Wed, 29 Jul 2009 21:36:31 -0700 (PDT), Carl Banks
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 Python
>library docu
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, -
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
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
On Sat, 13 Jun 2009 19:03:38 -0700 (PDT), John Machin
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 fundamental. D
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
In my programs the 'break' fails to work. I've studied the docs for
3.0 and Programming in Python, neither of which are illuminating.
Simplest example :
while True :
num = int(input())
print(num)
if num == 0 :
break
print('done')
SyntaxError : invalid syntax( pointing t
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
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
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 th
16 matches
Mail list logo