Python : libarys?

Started by
0 comments, last by Captain P 15 years, 4 months ago
Recently ive started to learn python, to "fulfill" my dream of becoming a game designer. i originally chose python after starting to get very fustrated with c++ (not my first language but the syntax was different form html and php lol). My first idea was to search google for any tutorials (i also searched here and youtube), but although they taught me how to say "hello world" what i really needed to know was how simple a libary was to import into my python program/game. i'd also like to know how i import an image from my computer to the game via paint (who needs photoshop?) no doubt theres somthing like a "import ###image address###" command, but being a begginer i sadly dont know it, can anyone shine some light on my problem? thanks.
Advertisement
Quote:Original post by richell
My first idea was to search google for any tutorials (i also searched here and youtube), but although they taught me how to say "hello world" what i really needed to know was how simple a libary was to import into my python program/game.

Importing libraries is simple in Python indeed. import ..., where ... stands for the name of the module you wish to import. I'd bookmark this site if I were you - it's Pythons standard library documentation. Lots of useful stuff there.

Quote:i'd also like to know how i import an image from my computer to the game via paint (who needs photoshop?)

If you want to do a little bit more with art, you'll soon find Paint to be very, very limiting. Personally I quite like Paint.NET, it's pretty good for a free program. It's somewhere in between Paint and Photoshop in terms of functionality.

Quote:no doubt theres somthing like a "import ###image address###" command, but being a begginer i sadly dont know it, can anyone shine some light on my problem? thanks.

No, there's no 'import image' command, and Python, by default, does not provide image loading routines. However, there are several libraries that you can download that can do exactly that. If you want to modify or generate images, then Python Imaging Library (PIL) is a great choice. If you want to create games, then I'd suggest Pygame or Pyglet. Those sites contain some tutorials as well, which should help you getting started with them.
Create-ivity - a game development blog Mouseover for more information.

This topic is closed to new replies.

Advertisement