Python for Mac OSX 10.10.2

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
 

JustMartin

macrumors 6502a
Feb 28, 2012
743
177
UK
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?
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
8,559
3,966
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.
 

lukeg01

macrumors newbie
Jun 23, 2014
18
0
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.