Hi both Thanks for your replies. It seems to me then that filehandling in the Sage notebook is not as intuitive as it could be then. Now that you guys have told me about it, I see that the Sage command line works exactly as I would expect and I feel instantly at home with it.
The notebook interface,however, not so much! I expect to be able to cd, ls, pwd (or Mathematica equivalents) in the notebook just as I would in the command line and yet it seems that I can't (easily). os.listdir(os.getcwd()) looks horrid from a user's point of view IMO. Best Wishes, Mike On Dec 17, 1:09 pm, Minh Nguyen <[email protected]> wrote: > Hi Mike, > > On Thu, Dec 17, 2009 at 11:48 PM, Walking Randomly > > <[email protected]> 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
