Thanks Ian. I'm not worried about the os module being available. I use pygame in classes that I teach, and it seems like its just one more thing for students to understand and remember. I teach mostly art students, very few computer science students. I've used relative path like this: pygame.image.load('images/ball.png') for a long time and they had always worked for me. Sounds like you have seen this too. Unless I hear otherwise, I will use this approach as it is easier for students to comprehend. As an aside ... I did development in another language/environment (Adobe Director/Lingo) for many many years. Whenever we needed to specify a path, we had to build the full path including the folder delimiter character. I started working in that environment in the days of Mac OS9. At that time, the Mac folder separator character was the ":" colon character. I didn't realize it but the character on a Mac is now the "/", same as the Unix character - probably changed when OS X came out. I think either one will work on a Mac. When I started using Python, I thought it was very clever that I can use just the "/" character in Python, and Python seems to do whatever translation it needs to do to make the path work on the target system. Thanks, Irv
|