Python question

I know this is c++ which is why im posting this question here. I feel more comfortable posting here. Anyway just a small problem. Under idle the following line
print(cards[num_index][1], sep = ' ', end='')
runs fine however the terminal in ubuntu 13.10 says
1
2
3
4
 File "BlackJack.py", line 30
    print(cards[num_index][1], sep = ' ', end='')
                                   ^
SyntaxError: invalid syntax

Anybody know why this is? it doesn't like the sep = ' ' for whatever reason. I thought that was pretty standard to prevent that function from automatically skiping to the next line. Any help would be appreciated.
Last edited on
guys....so sorry to waste your time. Turns out that is apparently not correct syntax in 2.7(or whatever the default version of python Ubuntu 13.10 ships with) in the terminal i had typed
python <nameoffile.py>
I'm learning python 3 as it is the future and i am only 16(no need to learn old programming.
However if you type
python3 <nameoffile.py>
it runs fine. Hope i could help somebody by putting this python question on a c++ forom!:P
Last edited on
closed account (Dy7SLyTq)
i know you solved your problem but im just going to elaborate: python 2.7 isnt very backwards compatible with python 3. the default with ubuntu 12.04 LTS is 2.7 but i believe you can make it 3, however this is a bad idea as it is good to have both 2.7 and 3 just like it is good to compile for x86_64/x64 bit archetecture
Nothing wrong with using both, especially on debian based systems with it's alternatives system. http://manpages.ubuntu.com/manpages/lucid/man8/update-alternatives.8.html

For example, I have two versions of Java installed (1.6 & 1.7), and both OpenJDK and Oracle. update-alternatives makes it super simple to switch between them.
Unfortunately with Python you're pretty much forced to have both and to switch out which is default many times, since some tools only work with 2.7 and some tools only work with 3.x - it's gotten to the point where sometimes you will have two dependencies and each one needs a different version of python to build.
Yeah..can't wait till the day python 3 becomes standard. I hate it when things like this pop up. Same thing has happened to opengl and i am confused about what is really going on other than everything 2.0 seems to EVENTUALLY be going away
Same thing has happened to opengl


What do you mean? Any version of OpenGL below 3.0 is deprecated, standard OpenGL is 4.3. That is because the fixed function pipeline was never a great idea to start with, which is why the 2.0 documentation seems to be disappearing (why would you want to use it?). Of course, some systems like Windows only natively supports OpenGL 1, so that can lead to some problems...
Topic archived. No new replies allowed.