Plotting in Python on Android

Here’s something to get you started.(http://effbot.org/imagingbook/image.htm) I failed miserably with everything else. The code is rudimentary, just an example. I’ll work on the real thing later. It works out of the box in QPython. Did the whole thing on my tablet.

import Image

class Widget(object):
    def __init__(self, datum1 = None):
        self.datum1 = datum1

wa = []
n = 100
for i in range(n):
    wa.append(Widget(datum1=i))

im = Image.new(“RGB”, (512, 512), “white”)

pixData = im.load()
for i in range(n):
        pixData[i, wa[i].datum1] = 666

im.save(“test.jpg”)

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s