If I want to move to C++ and SDL in the future, is Python and pygame a good way to learn SDL?
pygame abstracts the SDL interface quite a lot, therefore I don't think there's much of an advantage carried over.
You can learn some techniques, ways to implement game logic etc. in SDL-based enviroment but after moving to C++/SDL you will have to use SDL functions directly, helper functions/objects from pyGame will be completely useles.
Yes. If python is much more natural to you than C++, it might be a good idea to learn pygame first. You'll have to go through a translation process when migrating to using SDL and C, but it should be a more-or-less one-to-one mapping.
You could try pyglet If you are targetting at OpenGL. It's much better thought out library than what pygame is.
But then, if you want to move to C++ and SDL in future, do it now. That way you actually learn SDL. But before doing such an irresponsible thing, it'd be perhaps a good idea to check into pyglet first. Just because for designing your apps properly in C++ as well no matter how bad your libraries are.
Of course. You can write a sdl game or tools in really less time.
You can start with this code that display the data/chimp.bmp into a 468x60 screen :
import pygame, sys,os
from pygame.locals import *
pygame.init()
window = pygame.display.set_mode((468, 60))
pygame.display.set_caption('Monkey Fever')
screen = pygame.display.get_surface()
monkey_head_file_name = os.path.join("data","chimp.bmp")
monkey_surface = pygame.image.load(monkey_head_file_name)
screen.blit(monkey_surface, (0,0))
pygame.display.flip()
def input(events):
for event in events:
if event.type == QUIT:
sys.exit(0)
else:
print event
while True:
input(pygame.event.get())
When you are familiar with SDL objects you can easily move to C++ (if you want again :p Pygame is fast and you can make a complexe game with it).
I wouldn't consider Python (or any managed or interpreted language, for that matter) a good way to learn any complex task, because it insulates the programmer from the workings of the system too much. As a friend of mine put it, "Python loves you and wants you to be happy." And that's all well and good if you already know the fundamentals, but if you want to learn, the last thing you want is a language that does all the work for you.
You'll learn the what very quickly, but not the why, and then when something goes badly wrong, (and it will eventually, in any non-trivial project,) you'll be left with no idea what's happening or why.
python won't prevent you off learning design and that's pretty much the more important thing to learn IMO, I'm doing a smash bros clone with pygame and I learnt a lot in design. And yet you will learn not to write too much suboptimal code too, python have clever and beautiful hacks too.
Python+PyGame is a really great idea for learning SDL.
I wrote a somewhat popular game that way. Python/PyGame seems much more advanced than SDL bindings to any other language, and one huge advantage compared to C++ is that don't have to compile code, and with some simple hacking can even modify a running program, and see the feedback live. It makes a huge huge difference - like using a GUI vector graphics program vs writing SVG in a text editor. Unfortunately you don't get this out of the box, because you need to adapt your program a bit to see it.
As for other advantages of PyGame, jrpg ran with very small changes on Linux, Windows, and OSX. I had to do some tweaks to fullscreen mode switching, and double buffering as there were some differences between OSes, but no recompilation was ever necessary. If you have any problems you can get good stack trace and debug your problems live, that's not really possible with C++ once you get a memory corruption or a segfault.
I don't really know how easy or how hard would it be to mix C++ and Python for your SDL games. I think it cannot be too hard, as PyGame is a pretty straightforward but very nicely made wrapper for SDL, and Python/C++ mixing is supposed to be easy enough.