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()









share|improve this question
























  • 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












  • 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

















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()









share|improve this question
























  • 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












  • 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















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()









share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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












  • 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




















  • 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












  • 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


















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



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Full-time equivalent

さくらももこ

13 indicted, 8 arrested in Calif. drug cartel investigation