Hello All,
I am using PIL function to change brightness of an image. But i am
getting an error when i am trying to save that image. Here is the code..
import Image
import ImageChops, ImageEnhance
import math, operator
file1 = Image.open("r10001t0.jpg")
file2 = Image.open("r10001t1.jpg")
washakie wrote:
> It's not pretty, but this is what seems to work... I'd be happy hear more
> about a better approach... I like the idea of using a list, but ran into
> troubles with min and max, maybe I don't entirely understand the lambda
> function, but when I tried a list, I got an error that m
Alan Gauld wrote:
>> def values(self):
>> return (self.name, self.wealth, self.strenth)
>>
>> Or get rid of values() entirely and just refer to the attributes
>
> Nope, I don't like that as much since it encourages direct
> access.
Maybe we just need to agree to disagree here. I don't see
It's not pretty, but this is what seems to work... I'd be happy hear more
about a better approach... I like the idea of using a list, but ran into
troubles with min and max, maybe I don't entirely understand the lambda
function, but when I tried a list, I got an error that min() has no optional
va
Rob Stevenson wrote:
> Title = book.ProductName
> printstring = isbn + "\t" + book.ProductName + "\t" +
> book.Authors.Author + "\tUsed from...\t" + book.UsedPrice + "\tNew
> price\t" + book.OurPrice
> print printstring
> print printstring >> fle
Hello,
Sorry to be dense, but I'm having trouble writing to a file...
I have a list of book numbers - ISBNs in a file, one per line... (see list
at bottom of this message)
my code below...
import amazon
amazon.setLicense(' -- my amazon id is in here when I run - ')
isbn_list = "c:\\ISBN.txt"
a
by amazon ID in my message I meant my web services license number.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
"washakie" <[EMAIL PROTECTED]> wrote
> dates, to selected dates (Tstart, Tend)... Now, I need to get all
> the dates
> (slice) from the dictionary in between the two dates TstartNew and
> TendNew.
> Basically, I need to know what the 'index' is for them in the in the
> dictionay dates_dt. How c
"Kent Johnson" <[EMAIL PROTECTED]> wrote
>> e = Explorer()
>>
>> e.describe(withText=True) # gets the long version
>>
>> or
>>
>> print """
>> You are an explorer whose name is %s,
>> You have wealth of %s and strength of %s
>> """ % e.describe() # uses tuple result
>
> Um, yuck. A functio
First off, here is the code I am working with so far.
import random
from livewires import games, color
games.init(screen_width = 640, screen_height = 480, fps = 50)
controls = "Use The Arrow Keys to Move and the Spacebar to Shoot"
game_controls = games.Message(value = controls,
washakie wrote:
> Hello,
>
> I'm using the code below to select the closest dates in a dictionary of
> dates, to selected dates (Tstart, Tend)... Now, I need to get all the dates
> (slice) from the dictionary in between the two dates TstartNew and TendNew.
> Basically, I need to know what the 'ind
Hello,
I'm using the code below to select the closest dates in a dictionary of
dates, to selected dates (Tstart, Tend)... Now, I need to get all the dates
(slice) from the dictionary in between the two dates TstartNew and TendNew.
Basically, I need to know what the 'index' is for them in the in t
"Kent Johnson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Timothy Sikes wrote:
>
>> Anyone have any advice on good tutorials/books/examples of python
>> network programming?
>
> The book "Foundations of Python Network Programming" ;-) is pretty
> good.
> http://www.apress.com
Alan Gauld wrote:
> class Explorer(object):
> fmtStr = """
> My name is %s
> and I have wealth of $%s and
> strength of %s"""
>
> # other code here
>
> def describe(withText=False)
> values = (self.name, self.wealth, self.strenth)
> if not withText:
>
"bhaaluu" <[EMAIL PROTECTED]> wrote
> When you're designing a program, how do you go about dealing
> with text descriptions, like the descriptions for a room? Here is an
> example of a room description:
>
> THIS IS THE AUDIENCE CHAMBER
> THERE IS A WINDOW TO THE WEST. BY LOOKING TO THE RIGHT
> THR
> ..., I'd like to have the finished program
> be identical to the procedural program as far as I/O goes.
You could do it but it would be easier to change it a little
because the original games prompts etc betray its internal
structure. You can just get the objects to return their attributes
an
On Sat, Feb 09, 2008 at 09:21:41AM +, dave selby wrote:
> Hi all,
>
> Returning to python after a brief affair with C++, I have the following code
> ...
>
> if (items.has_keys('snapshot_interval')):
> self.snap_init[i] = items['snapshot_interval']
>
bhaaluu wrote:
> When you're designing a program, how do you go about dealing
> with text descriptions, like the descriptions for a room? Here is an
> example of a room description:
>
> THIS IS THE AUDIENCE CHAMBER
> THERE IS A WINDOW TO THE WEST. BY LOOKING TO THE RIGHT
> THROUGH IT YOU CAN SEE
On Feb 9, 2008 8:46 AM, Alan Gauld <[EMAIL PROTECTED]> wrote:
> "bhaaluu" <[EMAIL PROTECTED]> wrote
>
Some more thoughts on designing here.
You said I can use the procedural program as a program "requirement"
because it defines I/O. Even though the OOP program will have the
data and functions in
Timothy Sikes wrote:
> Anyone have any advice on good tutorials/books/examples of python network
> programming?
The book "Foundations of Python Network Programming" ;-) is pretty good.
http://www.apress.com/book/view/9781590593714
Kent
___
Tutor maill
Your game is perfectly within reach of a novice programmer. Board
Games are often used as the final project for early courses at Georgia
Tech that many people take who aren't going to be programmers for a
living. You're also going to chop up some code you didn't write and
make it do something funda
"bhaaluu" <[EMAIL PROTECTED]> wrote
> the second chapter deals with a Blackjack game. One thing I noticed
> (and remember, this is a Noob's viewpoint): The classes seemed to be
> designed from small to large, rather than from large to small.
As I mentioned in an earlier mail it tends to oscillate
Damian Archer wrote:
> I have written what i see as a pretty decent script to resolve this
> question:
>
> Write an improved version of the Chaos program from Chapter 1 that
> allows a user to input two initial
> values and the number of iterations and then prints a nicely formatted
> table showin
On Sat, Feb 09, 2008 at 09:21:41AM +, dave selby wrote:
> Hi all,
>
> Returning to python after a brief affair with C++, I have the following code
> ...
>
> if (items.has_keys('snapshot_interval')):
> self.snap_init[i] = items['snapshot_interval']
>
On Feb 9, 2008 4:09 AM, Alan Gauld <[EMAIL PROTECTED]> wrote:
>
> "Tiger12506" <[EMAIL PROTECTED]> wrote
>
> > Are some simple examples off the top of my head. It's not difficult
> > to model
> > real-life things with classes, but ...
>
> This is a good point, it is excellent practice for thinking
> Hi all,
>
> Returning to python after a brief affair with C++, I have the
> following code ...
>
>if (items.has_keys('snapshot_interval')):
>self.snap_init[i] = items['snapshot_interval']
>else:
>self.snap_init[i] = 0
>
> I
Hi all,
Returning to python after a brief affair with C++, I have the following code ...
if (items.has_keys('snapshot_interval')):
self.snap_init[i] = items['snapshot_interval']
else:
self.snap_init[i] = 0
I thought Python h
"Tiger12506" <[EMAIL PROTECTED]> wrote
> Are some simple examples off the top of my head. It's not difficult
> to model
> real-life things with classes, but ...
This is a good point, it is excellent practice for thinking
about the responsibilities of objects
> ...it is much more difficult to m
28 matches
Mail list logo