Re: [pygame] image-loading path

2008-07-15 Thread Olaf Nowacki
thanks a lot everybody! my path was not quite right i finaly found out (thanks to os.path.abspath). the whole problem arose because i want to move my project to a package (there are way to many files now for 1 folder). i thought quite a while about and now want to use this structure: [project] |-

Re: [pygame] image-loading path

2008-07-14 Thread Paul Pigg
Oh yeah, forgot about mentioning that - I just used the OP example, but if you want cross-platform support, that is definately the way to go. :) --p On Mon, Jul 14, 2008 at 11:04 AM, DR0ID <[EMAIL PROTECTED]> wrote: > Hi > > btw, I would use os.path.join(...) to join your path (because > /home/u

Re: [pygame] image-loading path

2008-07-14 Thread DR0ID
Hi btw, I would use os.path.join(...) to join your path (because /home/users/... might look different on different platforms e.g. \home\users\... ). Usage: p = os.path.join('home', 'users', ...) ~DR0ID Paul Pigg schrieb: I would use os.path.abspath() to see if the path you think you are p

Re: [pygame] image-loading path

2008-07-14 Thread Paul Pigg
I would use os.path.abspath() to see if the path you think you are passing is what is actually being passed. e.g., import os, pygame p = os.path.abspath("../images/image.png") print p pygame.image.load(p) --p On Mon, Jul 14, 2008 at 9:23 AM, Dan Krol <[EMAIL PROTECTED]> wrote: > Lets say you

Re: [pygame] image-loading path

2008-07-14 Thread Dan Krol
Lets say you have: /home/user/project/ /home/user/project/images /home/user/project/scriptst/game.py You say: cd /home/user/project/ python scripts/game.py You would want your images referenced as "images/image.png" If however, you say: cd /home/user/project/scripts python game.py You would

Re: [pygame] image-loading path

2008-07-14 Thread Olaf Nowacki
can you give an example? 2008/7/14 Forrest Voight <[EMAIL PROTECTED]>: > Yes, but the path is relative to where you are running the script > from, not where the script is. > > On Mon, Jul 14, 2008 at 11:43 AM, Olaf Nowacki <[EMAIL PROTECTED]> wrote: > > hi everyone, > > is it possible to load an

Re: [pygame] image-loading path

2008-07-14 Thread Forrest Voight
Yes, but the path is relative to where you are running the script from, not where the script is. On Mon, Jul 14, 2008 at 11:43 AM, Olaf Nowacki <[EMAIL PROTECTED]> wrote: > hi everyone, > is it possible to load an image with pygame.image.load() that is not in the > same folder (or a subfolder), bu

[pygame] image-loading path

2008-07-14 Thread Olaf Nowacki
hi everyone, is it possible to load an image with pygame.image.load() that is not in the same folder (or a subfolder), but higher up in the file-tree? i tried giving "../data/images/image.png" as argument, but it didn't work. here i tried to illustrate what i mean: [game] |- [engine] |- tools