Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kevinh6673

macrumors newbie
Original poster
Feb 5, 2015
1
0
I am a complete noob to this. Actually trying to work through some of this for a class I am taking. We are using python to right protocols for networking assignments.

So I have installed Python 3.4.2. I go to right a very simple code and it isn't working. x = raw_input ("enter your name: "). The issue I am having is, it will not allow me to enter "_", the underscore.

Thank you for the help.

Kevin
 
So, are you doing this in Python directly - that is, did you open a terminal session and issue the python command and then try your x= at the prompt? When you say 'Won't let you _' does it just not appear on the screen or does it complain in some other way

Have you tried 'input' instead of raw_input?
 
raw_input() is Python 2.x

It's just input() in Python 3.x

If you're working with someone else or doing this as an assignment, I would check which version of Python it should be done in.

If you're doing this for yourself, feel free to use whichever version. I stick with 2.7.x because everything is compatible with it - sometimes I have to use old libraries that aren't compatible with 3.x.
 
Hello
This is because you use python 3.x I recommend sticking to 2.x cause like everything on the internet in written in it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.