On Sep 24, 2009, at 8:27 AM, Jonathan Lundell wrote:

>
> On Sep 24, 2009, at 7:40 AM, pwoolf wrote:
>
>> Thanks for the suggestion Yarko.  Here is the script attached.
>
> A small correction. I'm doubtful that
>
> os.system("cd ~/")
>
> will work as you expect, since it's going to change the directory in a
> child process, and not affect the caller's environment (or the
> environment of the subsequent child processes).
>
> Instead, use
>
> os.chdir(os.path.expanduser("~/"))

For similar reasons, this won't work as expected:

os.system("source .bash_profile")


Also, you're creating .bash, but sourcing .bash_profile. Is that what  
you intend? Suggestion: bind some of these literal strings to variable  
names so you don't keep repeating them and taking the chance of making  
a mistake.

--~--~---------~--~----~------------~-------~--~----~
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