It's trying to launch GhostScript, and failing. The broken pipe is a clue
that its trying to communicate with external software. Most likely, you
don't have ghostscript installed. Google Ghostscript and you should find
instructions for installing on windows (I'm fairly sure there is a port).
Hi.. I also asked this question on the imaging group but thought people here
might have insights as well..
all of the following code executes interactively except the last line.
Converting a .jpg file to .png works fine. I'm using the PIL version for Python
2.6. Any suggestions will be greatly
GoodPotatoes wrote:
I am using the module active_directory and have an ad object called
myuser.
I would like to run a series of statements like:
myuser.attribute
where attribute is a string variable, but python says that this is not
the correct syntax.
error:
for x in myuser.properties:
GoodPotatoes wrote:
I am using the module active_directory and have an ad object called
myuser.
I would like to run a series of statements like:
myuser.attribute
where attribute is a string variable, but python says that this is not
the correct syntax.
error:
for x in myuser.properties:
I am using the module active_directory and have an ad object called myuser.
I would like to run a series of statements like:
myuser.attribute
where attribute is a string variable, but python says that this is not the
correct syntax.
error:
for x in myuser.properties:# "myuser.properties" r
On 10/15/2009 7:36 AM Wayne Werner said...
Is that the most pythonic way of validating? Is there a better way?
Pythonic in part having been addressed, I've some further comments to
your valid_choice code... -- Emile
def valid_choice(choice, min, max):
# don't use min and max -- they shadow
On Thu, Oct 15, 2009 at 2:04 PM, markus kossner wrote:
> Hi,
> let's simply start with an example:
>
> #!/usr/bin/python2.6
> import numpy as n
>
> def calculate(a,b=3,c=4):
> print b
> return n.sqrt(n.exp(a*b+c)/n.exp(c)**2)
>
> from multiprocessing import Pool
> p = Pool(processes=
Hi,
let's simply start with an example:
#!/usr/bin/python2.6
import numpy as n
def calculate(a,b=3,c=4):
print b
return n.sqrt(n.exp(a*b+c)/n.exp(c)**2)
from multiprocessing import Pool
p = Pool(processes=2)
a_list=range(10)
result=p.map(calculate,a_list)
This code works q
Maybe there's a prettier way to do this, but I did it explicitly like
this because the "transpose" I needed was specific to the structure of
the game payoff matrix; it isn't a normal mathematical transpose. I
agree that it's hard to read but I'm not sure the specific needs of
this applicat
On Thu, Oct 15, 2009 at 01:33:51PM -0400, Che M wrote:
>
>
>
> > In particular, I'm trying to run a simple prisoner's dilemma game, and
> > I want to make a "game" object that has a method which returns the
> > "game" object with the payoffs reversed; that is, the payoff matrix
> > from th
"Che M" wrote
Since this is the tutor list, I'd like to ask some questions about
structures used here that I haven't encountered before. I hope
you'll excuse me asking
Thats OK.
class Payoffs(list):
def __init__(self, value=None):
list.__init__(self)
This class is a list
"William Witteman" wrote
You need a loop, and putting a while True: around the whole thing
solves it nicely. Don't *call* the function again, just loop back
and do the operation again. That's what loops are for.
True, that's why my code currently looks like this:
Personally I don't think
> In particular, I'm trying to run a simple prisoner's dilemma game, and
> I want to make a "game" object that has a method which returns the
> "game" object with the payoffs reversed; that is, the payoff matrix
> from the other player's point of view. Basically a kind of transpose
> wh
2009/10/15 Wayne Werner :
>
>
> On Thu, Oct 15, 2009 at 10:50 AM, Rich Lovely
> wrote:
>>
>> 2009/10/15 Wayne Werner :
>> > Hi,
>> > I'm writing a text based menu and want to validate the user input. I'm
>> > giving the options as integers, and I want to make sure the user enters
>> > a
>> > prope
On Thu, Oct 15, 2009 at 10:50 AM, Rich Lovely wrote:
> 2009/10/15 Wayne Werner :
> > Hi,
> > I'm writing a text based menu and want to validate the user input. I'm
> > giving the options as integers, and I want to make sure the user enters a
> > proper value.
> > Here's what I've got so far: http:
2009/10/15 Kent Johnson :
> On Wed, Oct 14, 2009 at 10:48 PM, Wayne wrote:
>
>> Using zip is redundant for me, this is what my function looks like now:
>> def crypt(msg, mask):
>> m = itertools.cycle(mask)
>> word = ''
>> for l in msg:
>> word += chr(ord(l) ^ ord(m.next()))
>>
2009/10/15 Wayne Werner :
> Hi,
> I'm writing a text based menu and want to validate the user input. I'm
> giving the options as integers, and I want to make sure the user enters a
> proper value.
> Here's what I've got so far: http://pastebin.com/m1fdd5863
> I'm most interested in this segment:
>
Oh my goodness, it really is that easy! I guess I assumed that was
too simple to work. Silly me. Thanks Andre!
On Oct 15, 2009, at 10:31 AM, Andre Engels wrote:
On Thu, Oct 15, 2009 at 5:14 PM, David Perlman
wrote:
I'm trying to figure out how to define a class so that its
instances ha
On Thu, Oct 15, 2009 at 5:14 PM, David Perlman wrote:
> I'm trying to figure out how to define a class so that its instances have a
> method that return a different object of the same class.
>
> In particular, I'm trying to run a simple prisoner's dilemma game, and I
> want to make a "game" object
I'm trying to figure out how to define a class so that its instances
have a method that return a different object of the same class.
In particular, I'm trying to run a simple prisoner's dilemma game, and
I want to make a "game" object that has a method which returns the
"game" object with t
Skylar Struble wrote:
ok so im working on a text based rpg game and am trying to get this
code to work,
items = ['crate', 'grave']
lookwords = ['look', 'examine', 'investigate','open')
input1 = raw_input('What do you want to do:')
for word in items:
for word2 in lookwords:
if word a
Hi,
I'm writing a text based menu and want to validate the user input. I'm
giving the options as integers, and I want to make sure the user enters a
proper value.
Here's what I've got so far: http://pastebin.com/m1fdd5863
I'm most interested in this segment:
while True:
choice = raw_
Skylar Struble wrote:
lookwords = ['look', 'examine', 'investigate','open')
The ')' probably has to be a ']'.
if word and word2 in input1:
Try this: if (word in input1) and (word2 in input1):
it prints out all of the print things 2 times when i want it to print
1 or the other
ok so im working on a text based rpg game and am trying to get this
code to work,
items = ['crate', 'grave']
lookwords = ['look', 'examine', 'investigate','open')
input1 = raw_input('What do you want to do:')
for word in items:
for word2 in lookwords:
if word and word2 in input1:
On Thu, Oct 15, 2009 at 07:54:23AM -0400, Dave Angel wrote:
>William Witteman wrote:
>>Thanks to all who responded. There were several good points about the
>>code itself, all of which both helped and work.
>>
>>I will likely use Alan's example because I find it the most lucid, but
>>the other sug
William Witteman wrote:
Thanks to all who responded. There were several good points about the
code itself, all of which both helped and work.
I will likely use Alan's example because I find it the most lucid, but
the other suggestions are good signposts to other ways to do the same
thing (but r
Jose Amoreira wrote:
Alan, Kent, hello!
Thanks for your help. As for your "curiosity", I'm teaching elementary physics
to undergraduates in computer engineering. Trying to speak my students'
language, I wanted to show them simple applications that compute numerical
values for the kinematics fo
On Thu, Oct 15, 2009 at 5:28 AM, Mr Timothy Hall
wrote:
> whenever i run this part of the program, no matter what values i put in for
> vto, k1t etc... it always equals zero.
> im slightly aware of floating point numbers but im not sure why this will
> not give me a real answer.
> when i do it on
On Thu, Oct 15, 2009 at 11:28 AM, Mr Timothy Hall
wrote:
> hi,
> i am writing a program for a runge-cutter method of solving ODE's and im
> having a problem with one part.
>
> whenever i run this part of the program, no matter what values i put in for
> vto, k1t etc... it always equals zero.
> im
On Wed, Oct 14, 2009 at 10:48 PM, Wayne wrote:
> Using zip is redundant for me, this is what my function looks like now:
> def crypt(msg, mask):
> m = itertools.cycle(mask)
> word = ''
> for l in msg:
> word += chr(ord(l) ^ ord(m.next()))
> return word
With zip() and a ge
hi,
i am writing a program for a runge-cutter method of solving ODE's and im having
a problem with one part.
whenever i run this part of the program, no matter what values i put in for
vto, k1t etc... it always equals zero.
im slightly aware of floating point numbers but im not sure why this wi
Katt wrote:
Hello all,
I am currently using WinXP and python 2.6.2
I just installed PyWin32 v214 for python 2.6 from the following link:
[... snip lots of advice from other people ...]
Hi, Katt. Thanks for posting back over here. I must admit,
I hadn't realised you were posting to the tutor l
"Katt" wrote
lucky). So I will pursue all three types of changing color.
First I will try WConio, next to be followed by EasyGUI,
EasyGUI won;t help change colour, it is just a way of making
a command line script act like a GUI - by popping up dialog
boxes to capture input and dsplay messa
33 matches
Mail list logo