New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I get Rodeo to set the current working directory as that of the current script? #233

Closed
izaakm opened this Issue Feb 13, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@izaakm

izaakm commented Feb 13, 2016

This is important to me because I work with scripts on two different machines.

Given the following script located at "/path/to/my-script.py":

import os
import sys
print os.path.dirname(sys.argv[0])
print os.getcwd()

When I run this in the Rodeo IDE, I get this output:

/usr/local/lib/python2.7/site-packages/ipykernel
/usr/local/lib/python2.7/site-packages/ipykernel

But what I expect, and when I run this from Terminal, is something like the following:

$ python /path/to/my-script.py
/path/to
/Users/home

Rodeo v1.2.1
OSX 10.11.3

@izaakm izaakm changed the title from How can I get Rodeo to recognize the current working directory as that of the current script? to How can I get Rodeo to set the current working directory as that of the current script? Feb 14, 2016

@AlJohri

This comment has been minimized.

Show comment
Hide comment
@AlJohri

AlJohri Feb 17, 2016

I have a similar issue where if I run:

>>> !pwd
/

then

>>> !cd ~

>>> !pwd
/

also

>>> !cd /Users/johria/

>>> !pwd
/

AlJohri commented Feb 17, 2016

I have a similar issue where if I run:

>>> !pwd
/

then

>>> !cd ~

>>> !pwd
/

also

>>> !cd /Users/johria/

>>> !pwd
/
@glamp

This comment has been minimized.

Show comment
Hide comment
@glamp

glamp Feb 22, 2016

Contributor

I'm assuming you're launching Rodeo from the OSX Dock?

You can switch working directories form the preferences tab
image

Though there is a bug in that the console doesn't also switch #176 (working on this 😄)

To switch the console, you can just run cd as you normally would.
image

To set the default working directory for the console and the file picker, go to Preferences > Default Working Directory

image

Contributor

glamp commented Feb 22, 2016

I'm assuming you're launching Rodeo from the OSX Dock?

You can switch working directories form the preferences tab
image

Though there is a bug in that the console doesn't also switch #176 (working on this 😄)

To switch the console, you can just run cd as you normally would.
image

To set the default working directory for the console and the file picker, go to Preferences > Default Working Directory

image

@izaakm

This comment has been minimized.

Show comment
Hide comment
@izaakm

izaakm Feb 22, 2016

Yes, I'm opening Rodeo from Finder.

Once I open this example script in Rodeo, and set/change directories as you have indicated, I still don't get the expected output in relation to using sys.argv[0]; below is the console output:

>>> import os 
... import sys 
...  
... print os.path.dirname(sys.argv[0]) 
... print os.getcwd() 
... 
/usr/local/lib/python2.7/site-packages/ipykernel
/Users/username/temp

screenshot 2016-02-22 10 18 12

izaakm commented Feb 22, 2016

Yes, I'm opening Rodeo from Finder.

Once I open this example script in Rodeo, and set/change directories as you have indicated, I still don't get the expected output in relation to using sys.argv[0]; below is the console output:

>>> import os 
... import sys 
...  
... print os.path.dirname(sys.argv[0]) 
... print os.getcwd() 
... 
/usr/local/lib/python2.7/site-packages/ipykernel
/Users/username/temp

screenshot 2016-02-22 10 18 12

@glamp

This comment has been minimized.

Show comment
Hide comment
@glamp

glamp Sep 29, 2016

Contributor

take a look at the new release (2.4+). should answer all these questions!

image

Contributor

glamp commented Sep 29, 2016

take a look at the new release (2.4+). should answer all these questions!

image

@glamp glamp closed this Sep 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment