Hi Mike,

On Thu, Dec 17, 2009 at 11:48 PM, Walking Randomly
<michael.p.crouc...@googlemail.com> wrote:
> Hi
>
> When in a Sage notebook how do I find what the current working
> directory is

Try this:

os.getcwd()


> and how do I do a directory listing?

Try this:

os.listdir(os.getcwd())

Other operating system services are documented in the Python library
reference [1].


> For example in
> MATLAB I might do
>
> pwd
>
> to print the working directory and
>
> ls
>
> to do a directory listing.

You can also do "ls" and "pwd" at the Sage command line interface.


[1] http://docs.python.org/library/os.html

-- 
Regards
Minh Van Nguyen

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to