Sep-16-2017, 06:12 PM
Sep-16-2017, 06:19 PM
Yes.
Sep-17-2017, 01:38 PM
Thank you for this answer. The email notice of your post also included a link to the source code for Turtle.py and this is very informative. I would like to know how write in Python to place a pixel on the screen at position x,y with a red-green-blue color a,b,c without an add on.
The source code reveals that other graphics packages are used in Turtle. Can you help me find the root package or subroutine that does this.
Thank you for your help.
The source code reveals that other graphics packages are used in Turtle. Can you help me find the root package or subroutine that does this.
Thank you for your help.
Sep-17-2017, 01:42 PM
It uses Tkinter, which is a GUI package that comes with Python. If you want to learn Tkinter, there are plenty of tutorials out there.
Sep-18-2017, 10:13 PM
ichabod801.
Thank you for these leads.
I have not yet found a command like move Z = (R, G, B) to position (x,y) on the screen in the source code for Tkinter. I really don't want to use Tkinter. I am looking for the Python code that places a pixel at point (x,y) with a color #FF00DD or any such color. The important part is point (x,y).
I found this discussion of import sys, which exists in Turtle:
https://stackoverflow.com/questions/6409...ource-code
I wonder if sys contains a stretch of code that illustrates how pixels are created on the computer screen.
My current suspicion is that a Python script that contains the line import sys will allow the script to place a pixel anywhere on the computer scree. Is this true?
Thank you for your help.
Thank you for these leads.
I have not yet found a command like move Z = (R, G, B) to position (x,y) on the screen in the source code for Tkinter. I really don't want to use Tkinter. I am looking for the Python code that places a pixel at point (x,y) with a color #FF00DD or any such color. The important part is point (x,y).
I found this discussion of import sys, which exists in Turtle:
https://stackoverflow.com/questions/6409...ource-code
I wonder if sys contains a stretch of code that illustrates how pixels are created on the computer screen.
My current suspicion is that a Python script that contains the line import sys will allow the script to place a pixel anywhere on the computer scree. Is this true?
Thank you for your help.
Sep-19-2017, 12:33 AM
I don't know of anything in the sys module that allows changing just one pixel of the monitor. I don't know of anything in Python that allows changing just one pixel of the monitor.
Sep-28-2017, 08:04 PM
Is that even something the operating system will allow? Writing to random pixels is normally the opposite of what windowing systems aim for... so this isn't really a question of "how do I do this in python", and more of "how do I do this at all?".
Maybe the easiest way to "fake it" would be to create a tk dialog box without any window chrome, and a transparent background, so the entire window was transparent, and then just draw somewhere on that canvas?
Maybe the easiest way to "fake it" would be to create a tk dialog box without any window chrome, and a transparent background, so the entire window was transparent, and then just draw somewhere on that canvas?
Sep-28-2017, 08:22 PM
You could also look at one of my favorites- colorama, it"s not going to give you 'pixel' control, but still fun to use. You could also try Python Imaging Library which would allow you to play with pixels.