[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Help with the 3rd Lecture, first tutorial



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

kevin hayes wrote:
> (1) I run python by c:\Python25>Python <Enter>
> 
> Once in the interpreter, I can import the pygame modules, initialize
> Python, make a window, but when I try to set the caption it won't work.
> I did get it to work in the GUI, however.
>  
> pygame.display.set_caption('Monkey Fever')
> 
> (2) C:\Program Files\examples\data\chimp.bmp   "Is the path to the image"
> 
> When trying to load the image with:
> 
> monkey_head_file_name = 
> os.path.join("data","chimp.bmp")
>>>> print monkey_head_file_name                             "Creating a relative Path"
> 
> data\chimp.bmp
> 
> monkey_surface = pygame.image.load(monkey_head_file_name)    "From the tutorial...trying to load the image"

Seems to me that the tutorial expects you to be running python from
inside the c:\Program Files\examples directory. Lukasz has tried to
explain how to change directory to that directory and then run Python,
and RR4CLB has put together some batch scripts for you to run Python
from that directory. You could also use the os.chdir function, as
follows (on a Linux system):

>>> import os
>>> os.getcwd()
'/home/ethan'
>>> os.chdir("/home/ethan/tests/")
>>> os.getcwd()
'/home/ethan/tests'

If you chdir() to 'c:\Program Files\examples', you should be able to
run the examples directly as written.

Hope this helps!

Ethan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHKS91hRlgoLPrRPwRAsTUAJ9da7op3jDVOom0vHNJxlDsQS0EVQCgjLAo
bGHnlPOsO+VV6WuuSqX4L4I=
=MPsQ
-----END PGP SIGNATURE-----