We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,389 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

chaning an input color

i am new to python and am working on a simple code for a project.
I am to end up with and output that says: "Please enter your name: Bubba"
I am to use

name = input("Please enter your name:")

However, when I input the name "Bubba" the project says it should end up being red. However when I run the program it ends up blue just like the "please enter our name" string.

I'm sure I'm missing something simple but I do not know what it is. Help?!

Oh and I am using Python 3.2.2 (i that has anything to do with it)

4
Contributors
10
Replies
8 Hours
Discussion Span
1 Year Ago
Last Updated
11
Views
RoqueyB
Newbie Poster
13 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

are you suppose to be using a tkinter window to display the output?

pyguy62
Posting Whiz
353 posts since Aug 2011
Reputation Points: 34
Solved Threads: 19
Skill Endorsements: 0

I'm supposed to run it in the idle window but write it in another empty window.
I just started learning python last week so i dont know about tkinter windows. (sorry, i dont know names of everything yet)

RoqueyB
Newbie Poster
13 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

I don't understand why they would want you to do that...http://mail.python.org/pipermail/tutor/2005-August/040327.html

pyguy62
Posting Whiz
353 posts since Aug 2011
Reputation Points: 34
Solved Threads: 19
Skill Endorsements: 0

Sorry, what I meant was I run it in IDLE to make sure it works and upload the .py to a site

and the fact that error messages are red is what confused me too when they said it needed to be in red.

this is exactly what the project says: Prompt the user for a name like this:

name = input("Please enter your name: ")

Input is shown in red.

RoqueyB
Newbie Poster
13 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

If you could post the exact assignment that might clear things up, I'm just having 2 issues with this: 1,Posting python to a site isn't really a "beginner" project, 2, Making the output color in IDLE change isn't something that's common practice.

pyguy62
Posting Whiz
353 posts since Aug 2011
Reputation Points: 34
Solved Threads: 19
Skill Endorsements: 0

that was the exact assignment. I am uploading it to athene. its for a class, and I have it working except for the fact that the input ("Bubba") is not red. Therefore I'm not getting the assignment correct.

RoqueyB
Newbie Poster
13 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

However when I run the program it ends up blue just like the "please enter our name" string.

Blue is correct,red comes if you make an error.
This is how it should be and has always been in IDLE.
You can try to change that color option->configure IDLE.
But that is just stuid,so leave alone.

snippsat
Posting Shark
957 posts since Aug 2008
Reputation Points: 482
Solved Threads: 344
Skill Endorsements: 8

Is input shown in the assignment red? i think you have other problem, but as you do not post your complete code, we can not know what.

pyTony
pyMod
Moderator
6,312 posts since Apr 2010
Reputation Points: 879
Solved Threads: 987
Skill Endorsements: 26

I feel that you may possibly be misinterpreting the assignment.

pyguy62
Posting Whiz
353 posts since Aug 2011
Reputation Points: 34
Solved Threads: 19
Skill Endorsements: 0

Yes i figured it out,
I was doing it right it was just the site was very picky and i forgot a space or something after saying "Please enter your name: "
Thank you guys though.
Sorry, if I wasted your time. I knew it was something simple I was missing but I didnt think it was that stupid!

RoqueyB
Newbie Poster
13 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0833 seconds using 2.7MB