Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Turtle
#1
There is a Python library package called Turtle which lets you draw lines. Is this package open source?

Thank you for your help.
Reply
#2
Yes.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
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.
Reply
#4
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.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#5
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.
Reply
#6
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.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#7
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?
Reply
#8
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.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  wn = turtle.screen() AttributeError: module 'turtle' has no attribute 'screen' Shadower 1 6,177 Feb-06-2019, 01:25 AM
Last Post: woooee
  Help! Turtle not working, even when we click the turtle demo in IDLE nothing happens. BertyBee 3 5,628 Jan-04-2019, 02:44 AM
Last Post: SheeppOSU

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020