[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] pygame and Ubuntu
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] pygame and Ubuntu
- From: Charles Joseph Christie II <sonicbhoc@xxxxxxxxx>
- Date: Mon, 30 Apr 2007 16:04:05 -0400
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Mon, 30 Apr 2007 16:04:14 -0400
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=PNUtELmbt7HSIkbzgfdu5Lh3HeG9q2MH0LhRQjYaUys3BNDLi/rkHwQ3m0rBzjlKLnsZAmyIJX8BAbKT0npRcvJFrzmRhwiWDA0inDTMVaMS0hshwaZ1jXCL7uHh8M2xeuA1nyCyG7iTV7nN5KKjQ/ir75iQM+sWPMg3lDpCuMk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=WAFACI6U7VpN2qtSKilv35W3udEu5ss3Z79t6ZozrGtMyEtoXS2UGzqnUlU7FciIYR+tqcWVbIwTpS3A7cMpjPQed9GRublsd96Y8XSH4DJFFr9joiXD2wmD6C0533XGo7XjZ1Dl5lBunzFRbqPTD/eDUv3zBQgFMlCWiqbflzk=
- In-reply-to: <20070430160909.GB28807@karnov.dreamhost.com>
- References: <20070429204514.3BF79BD63F@xprdmxin.myway.com> <000401c78aa6$bcea62b0$92e27744@dunamis34752e9> <20070430160909.GB28807@karnov.dreamhost.com>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
- User-agent: KMail/1.9.6
On Monday 30 April 2007 12:09:10 pm James Paige wrote:
> On Sun, Apr 29, 2007 at 05:38:33PM -0400, Jason Coggins wrote:
> > I am trying to run them from the desktop by double clicking on them then
> > selecting either run or run in terminal from the box that pops up. I
> > tried right clicking on the program to select "open with python" but that
> > was not an option. When I right clicked and selected "open with another
> > application" python was not listed on the application list. I know I
> > have python 2.5 installed because it states so on the synamtic package
> > manager.
> >
> > Jason
>
> I have had a lot of problems with this too. The problem is that most
> pygame games assume that that the current working directory has been set
> to the directory where the .py file is located. But when you
> double-click and pick "run" or right-click and pick "open with python",
> the current working directory does NOT get set, and the game cannot find
> its data files.
>
> What I do for my own games is something similar to this:
>
> import os
> import sys
> os.chdir(os.path.dirname(sys.argv[0]))
>
> That makes sure that the data files will always be found where you
> expect them.
>
> ---
> James Paige
That's good information. I'll have to remember to make my game do that too!