Re: Quick Problem

2006-04-18 Thread Lars Yencken
Hello, On Tue, 18 Apr 2006 19:05:06 -0700, [EMAIL PROTECTED] wrote: > Here is my code: > > cw = 0 #Computer wins total > uw = 0 # User wins total > > def win(who): > if who == 1: > cw = cw + 1# computer win > elif who == 2: > uw = uw + 1# user win > Try addi

Re: Path problem

2004-12-13 Thread Lars Yencken
On 13/12/2004, at 6:39 PM, Binu K S wrote: sys.path[0] will contain the path to the script. From the sys module documentation: "As initialized upon program startup, the first item of this list, path[0], is the directory containing the script that was used to invoke the Python interpreter. If the sc

Re: Path problem

2004-12-12 Thread Lars Yencken
Hi Binu, On 13/12/2004, at 4:11 PM, Binu K S wrote: This should get you the module's path: import sys sys.modules['rpy'].__file__ Unfortunately it's not the rpy module itself whose path I'm looking for. It's the absolute path of my module that I've created. If my script was called runRScript.py,

Path problem

2004-12-12 Thread Lars Yencken
Hello, I'm working on a project where my python modules are using persistent files in the same directory. As an example, we're using rpy, so a piece of python code might read: from rpy import * rScript = 'myScript.r' r.source(rScript) Now the problem with this is that whe