A loop in a graphics window?
up vote
0
down vote
favorite
I'm working on an assignment for class. I have most of it finished I just need to get the loop at the end to show up with the Unicode codes on the graphics window. Not sure what I need to do to get it to show up. I've tried a couple iterations of what I have there at the end and can't seem to get it to work.
from graphics import *
def main():
win = GraphWin("Unicode Window", 500, 500)
win.setCoords(0.0, 0.0, 10.0, 10.0)
text = Text(Point(5.0, 9.0), "This is a message coder to convert your message into Unicode.")
text.draw(win)
text2 = Text(Point(5.0, 8.0), "Enter your message below. Click the convert")
text2.draw(win)
text3 = Text(Point(5.0, 7.5), "button to see your message in Unicode.")
text3.draw(win)
message = Entry(Point(5.0, 6.0), 20)
message.setText("Enter the message here")
message.draw(win)
button = Text(Point(5.0, 4.5), "Convert")
button.draw(win)
rect = Rectangle(Point(4.0, 4.0), Point(6.0, 5.0))
rect.draw(win)
win.getMouse()
text4 = Text(Point(5.0, 3.0), "nHere are the Unicode codes:")
text4.draw(win)
for i in message:
unit = Text(ord(i), end =" ")
unit.draw(win)
print()
main()
python graphics zelle-graphics
add a comment |
up vote
0
down vote
favorite
I'm working on an assignment for class. I have most of it finished I just need to get the loop at the end to show up with the Unicode codes on the graphics window. Not sure what I need to do to get it to show up. I've tried a couple iterations of what I have there at the end and can't seem to get it to work.
from graphics import *
def main():
win = GraphWin("Unicode Window", 500, 500)
win.setCoords(0.0, 0.0, 10.0, 10.0)
text = Text(Point(5.0, 9.0), "This is a message coder to convert your message into Unicode.")
text.draw(win)
text2 = Text(Point(5.0, 8.0), "Enter your message below. Click the convert")
text2.draw(win)
text3 = Text(Point(5.0, 7.5), "button to see your message in Unicode.")
text3.draw(win)
message = Entry(Point(5.0, 6.0), 20)
message.setText("Enter the message here")
message.draw(win)
button = Text(Point(5.0, 4.5), "Convert")
button.draw(win)
rect = Rectangle(Point(4.0, 4.0), Point(6.0, 5.0))
rect.draw(win)
win.getMouse()
text4 = Text(Point(5.0, 3.0), "nHere are the Unicode codes:")
text4.draw(win)
for i in message:
unit = Text(ord(i), end =" ")
unit.draw(win)
print()
main()
python graphics zelle-graphics
What were you trying to accomplish using thatend=
keyword argument in theunit = Text(ord(i), end=" ")
line?Text
widgets don't accept such an argument.
– martineau
Nov 11 at 1:28
Honestly not sure. Everything within the text is how my teacher had it when he showed us in class. He just didn't do it in a Window which is what I've having trouble with. The way he had it was actually: for i in message: print(ord(i), end =" ") I just need to figure out how to print that loop within the Window.
– JuiceyMoon
Nov 11 at 7:27
Well it is not supported by the version of the graphics module I have. I encountered the issue trying to run your code a reproduce the issue. At any rate, the other thing I noticed without being able to run it is that the use oford(i)
. That shouldn't be necessary becausei
is a character ofmessage
.
– martineau
Nov 11 at 7:35
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm working on an assignment for class. I have most of it finished I just need to get the loop at the end to show up with the Unicode codes on the graphics window. Not sure what I need to do to get it to show up. I've tried a couple iterations of what I have there at the end and can't seem to get it to work.
from graphics import *
def main():
win = GraphWin("Unicode Window", 500, 500)
win.setCoords(0.0, 0.0, 10.0, 10.0)
text = Text(Point(5.0, 9.0), "This is a message coder to convert your message into Unicode.")
text.draw(win)
text2 = Text(Point(5.0, 8.0), "Enter your message below. Click the convert")
text2.draw(win)
text3 = Text(Point(5.0, 7.5), "button to see your message in Unicode.")
text3.draw(win)
message = Entry(Point(5.0, 6.0), 20)
message.setText("Enter the message here")
message.draw(win)
button = Text(Point(5.0, 4.5), "Convert")
button.draw(win)
rect = Rectangle(Point(4.0, 4.0), Point(6.0, 5.0))
rect.draw(win)
win.getMouse()
text4 = Text(Point(5.0, 3.0), "nHere are the Unicode codes:")
text4.draw(win)
for i in message:
unit = Text(ord(i), end =" ")
unit.draw(win)
print()
main()
python graphics zelle-graphics
I'm working on an assignment for class. I have most of it finished I just need to get the loop at the end to show up with the Unicode codes on the graphics window. Not sure what I need to do to get it to show up. I've tried a couple iterations of what I have there at the end and can't seem to get it to work.
from graphics import *
def main():
win = GraphWin("Unicode Window", 500, 500)
win.setCoords(0.0, 0.0, 10.0, 10.0)
text = Text(Point(5.0, 9.0), "This is a message coder to convert your message into Unicode.")
text.draw(win)
text2 = Text(Point(5.0, 8.0), "Enter your message below. Click the convert")
text2.draw(win)
text3 = Text(Point(5.0, 7.5), "button to see your message in Unicode.")
text3.draw(win)
message = Entry(Point(5.0, 6.0), 20)
message.setText("Enter the message here")
message.draw(win)
button = Text(Point(5.0, 4.5), "Convert")
button.draw(win)
rect = Rectangle(Point(4.0, 4.0), Point(6.0, 5.0))
rect.draw(win)
win.getMouse()
text4 = Text(Point(5.0, 3.0), "nHere are the Unicode codes:")
text4.draw(win)
for i in message:
unit = Text(ord(i), end =" ")
unit.draw(win)
print()
main()
python graphics zelle-graphics
python graphics zelle-graphics
edited Nov 11 at 1:10
martineau
64.7k887172
64.7k887172
asked Nov 11 at 0:20
JuiceyMoon
1
1
What were you trying to accomplish using thatend=
keyword argument in theunit = Text(ord(i), end=" ")
line?Text
widgets don't accept such an argument.
– martineau
Nov 11 at 1:28
Honestly not sure. Everything within the text is how my teacher had it when he showed us in class. He just didn't do it in a Window which is what I've having trouble with. The way he had it was actually: for i in message: print(ord(i), end =" ") I just need to figure out how to print that loop within the Window.
– JuiceyMoon
Nov 11 at 7:27
Well it is not supported by the version of the graphics module I have. I encountered the issue trying to run your code a reproduce the issue. At any rate, the other thing I noticed without being able to run it is that the use oford(i)
. That shouldn't be necessary becausei
is a character ofmessage
.
– martineau
Nov 11 at 7:35
add a comment |
What were you trying to accomplish using thatend=
keyword argument in theunit = Text(ord(i), end=" ")
line?Text
widgets don't accept such an argument.
– martineau
Nov 11 at 1:28
Honestly not sure. Everything within the text is how my teacher had it when he showed us in class. He just didn't do it in a Window which is what I've having trouble with. The way he had it was actually: for i in message: print(ord(i), end =" ") I just need to figure out how to print that loop within the Window.
– JuiceyMoon
Nov 11 at 7:27
Well it is not supported by the version of the graphics module I have. I encountered the issue trying to run your code a reproduce the issue. At any rate, the other thing I noticed without being able to run it is that the use oford(i)
. That shouldn't be necessary becausei
is a character ofmessage
.
– martineau
Nov 11 at 7:35
What were you trying to accomplish using that
end=
keyword argument in the unit = Text(ord(i), end=" ")
line? Text
widgets don't accept such an argument.– martineau
Nov 11 at 1:28
What were you trying to accomplish using that
end=
keyword argument in the unit = Text(ord(i), end=" ")
line? Text
widgets don't accept such an argument.– martineau
Nov 11 at 1:28
Honestly not sure. Everything within the text is how my teacher had it when he showed us in class. He just didn't do it in a Window which is what I've having trouble with. The way he had it was actually: for i in message: print(ord(i), end =" ") I just need to figure out how to print that loop within the Window.
– JuiceyMoon
Nov 11 at 7:27
Honestly not sure. Everything within the text is how my teacher had it when he showed us in class. He just didn't do it in a Window which is what I've having trouble with. The way he had it was actually: for i in message: print(ord(i), end =" ") I just need to figure out how to print that loop within the Window.
– JuiceyMoon
Nov 11 at 7:27
Well it is not supported by the version of the graphics module I have. I encountered the issue trying to run your code a reproduce the issue. At any rate, the other thing I noticed without being able to run it is that the use of
ord(i)
. That shouldn't be necessary because i
is a character of message
.– martineau
Nov 11 at 7:35
Well it is not supported by the version of the graphics module I have. I encountered the issue trying to run your code a reproduce the issue. At any rate, the other thing I noticed without being able to run it is that the use of
ord(i)
. That shouldn't be necessary because i
is a character of message
.– martineau
Nov 11 at 7:35
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244719%2fa-loop-in-a-graphics-window%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What were you trying to accomplish using that
end=
keyword argument in theunit = Text(ord(i), end=" ")
line?Text
widgets don't accept such an argument.– martineau
Nov 11 at 1:28
Honestly not sure. Everything within the text is how my teacher had it when he showed us in class. He just didn't do it in a Window which is what I've having trouble with. The way he had it was actually: for i in message: print(ord(i), end =" ") I just need to figure out how to print that loop within the Window.
– JuiceyMoon
Nov 11 at 7:27
Well it is not supported by the version of the graphics module I have. I encountered the issue trying to run your code a reproduce the issue. At any rate, the other thing I noticed without being able to run it is that the use of
ord(i)
. That shouldn't be necessary becausei
is a character ofmessage
.– martineau
Nov 11 at 7:35