Dear all, I'm trying to attach a python script. I'm probably doing somethign wrong, but the weird thing is that what I do works for the command line but not from the notebook. Let me show you.
This works: ---------------------------------------------------------------------- | Sage Version 3.2.3, Release Date: 2009-01-05 | | Type notebook() for the GUI, and license() for information. | ---------------------------------------------------------------------- sage: os.getcwd() '/home/ricardo/sage-3.2.2' sage: os.chdir('/media/disk/thesiswork/thesis2009/sage/src/ sympy_files') sage: os.getcwd () '/media/disk/thesiswork/thesis2009/sage/src/sympy_files' sage: attach thesis_sympy_2009.py So no problem there. but this doesn't: sage: notebook() The notebook files are stored in: /home/ricardo/.sage//sage_notebook os.chdir('/media/disk/thesiswork/thesis2009/sage/src/sympy_files') attach thesis_sympy_2009.py --->Error attaching /home/ricardo/.sage/thesis_sympy_2009.py -- file not found os.getcwd() --->'/home/ricardo/.sage/sage_notebook/worksheets/admin/4/cells/3' ...so obviously os.chdir didn't change the dir where the notebook looks for files (mybe is not supposed to...). Thus, I tried using an absolute path instead: attach /media/disk/thesiswork/thesis2009/sage/src/sympy_files/ thesis_sympy_2009.py ---> Syntax Error: attach /media/disk/thesiswork/thesis2009/sage/src/sympy_files/ thesis_sympy_2009\ .py how could I use absolute paths with attach inside a notebook? Is there a workaround? I also tried setting the variable DIR to /media/disk/thesiswork/ thesis2009/sage/src/sympy_files/ and then using attach thesis_sympy_2009.py but it didn't work either thanks in advance for your help Ricardo --~--~---------~--~----~------------~-------~--~----~ 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 URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---