Draw a Pixel with Python
Hi!
I am trying to draw a pixel with python, but I can't. I am using this: canvas = Canvas(width=500, height=500, bg='white') canvas.pack(expand=YES, fill=BOTH) canvas.SetPixel(x,y,color) But I get the following error: AttributeError: Canvas instance has no attribute 'SetPixel' I have read in Internet that SetPixel really exists. Can someone help me? Thanks. |
First of all you should say what GUI toolkit you are working with: Is it Tk, wxPython, PyQT, PyGTK or something else entirely. If your seriously stuck on what methods a module has dir() and help() are the way to go as every decent GUI has python doc strings in the package
just do something like this: Code:
import module |
Hi!
I am a beginner in Python, so I don't know so much. I am using Tkinter GUI Toolkit. pgpython, do I have to do the following?: Code:
from Tkinter import Canvas |
yes dir returns a list of all the methods and attributes a object has, while help returns the doc string for a attribute. Hence their usefulness. Sorry i can't be of more but I haven't used tkinter for a long time
|
All times are GMT -5. The time now is 05:04 PM. |