for loop and user input in JES

I have a function

def decreaseRed(picture, amount):
    for p in getPixels(picture):
        value = getRed(p)
        setRed(p, value * amount)

I would like the function to ask the user to input the amount and then calculate that amount. I know this is probably simple but it has me stumped and I cant find the answer in a book.

Thank you

Answers


From the JES Guide:

amount = requestNumber("Enter Amount:")

You could also consider:

amount = requestInteger("Amount: ")

or

amount =requestIntegerInRange("Amount in range min-max:", min, max)

if you you want to constrain the possible values.


Need Your Help

ARC: Analyzer warnings with Objective-C code using core foundation

objective-c cocoa core-foundation clang-static-analyzer

Using the analyzer on some Objective-C | Cocoa / Core Foundation code, I got a few error that I can't fix because I don't understand them.

Tree not showing up when using TreeColumn

java swt

I'm having trouble displaying a Tree which contains column definitions:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.