On Thu, Aug 27, 2009 at 9:16 AM, ctalley<[email protected]> wrote:
>
> Thanks guys.  Yarko, you are nothing if not prolific - all I ever
> wanted to know and more. :-)
>
> I just felt like there must be some mechanism to tell python where to
> find files from the command prompt short of typing the entire path and
> that I was missing something.  I didn't really think pythonpath or
> sys.path were the right answer, but hey it was worth a shot.
>
> But this does work (I tried it)...
> python %web2pypath%\web2py.py --upgrade yes
>
> The only catch is that web2pypath has to be in the "short name" format
> (limit of 8 characters per path segment, no spaces, etc.).
>
> So in my case, this...
>
> C:\Documents and Settings\user\My Documents\w2p\web2py source\web2py

the problem with this, I suspect, is not the "short path" is needed -
it is that spaces are in the command line,
so python is seeing four command line paramaters in this (not one)....

Try, instead,

python "%web2pypath%"/web2py.py -upgrade yes

>
> looks like this...
>
> C:\DOCUME~1\user\MYDOCU~1\w2p\WEB2PY~2\web2py
>
>
> On Aug 26, 5:32 pm, Yarko Tymciurak <[email protected]> wrote:
>> ....
>>
>>
>>
>> >> I've added the web2py.py path to sys.path using sys.path.append and
>> >> verified using print sys.path
>>
>> > Again - this would have an effect if you wrote a script that did
>> > "import web2py" - but since web2py isn't a module (rather an
>> > application) this is of little use.
>>
>> sorry - this is wrong (I was thinking ahead too fast);
>>
>> what sys.path does is the same thing as setting your windows PATH
>> environment, but modifying only the current processes' copy of the
>> execution environment (e.g. it is lost after that process exits).
>>
>> So if you type "set" in a windows command (or "env" in unix/linux) you
>> will see your sys environment variables;  same for inside a running
>> pythong script - if you import sys, then the python interface for that
>> environment is as you show, and you can extend / modify it in your
>> running process.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to