# Where is walk.py located after I attach walk.sage?

 1 The sage tutorial Loading and Attaching Sage files states that if I create a file such as walk.sage containing: print "Hello world" print 2^4  and then load or attach it: sage: attach 'walk.sage' Hello world 16  I should get a walk.py file containing python code in the same directory as walk.sage. I can find no such file (I've even searched my the rest of my computer). Does anyone know where the file is? asked Nov 17 '11 rtrwalker 117 ● 1 ● 4 ● 12

 1 (Edit: I originally thought that there wasn't a file walk.py, but I think that's wrong.) Look in $HOME/.sage/temp/DIR0/DIR1/ where $HOME is your home directory, DIR0 has a name like \$HOSTNAME and DIR1 is a number, the process id of the Sage process. This directory is deleted when you quit Sage. If you want to produce a more permanent file walk.py, then from your shell prompt, run sage --preparse walk.sage. This will produce walk.py in the current directory. posted Nov 17 '11 John Palmieri 2700 ● 9 ● 23 ● 60 http://www.math.washingto... Nice - that is useful! But of course there is a walk.py ;-) kcrisman (Nov 17 '11)1If my ultimate goal is to write some sort of package, is there any point to me writing *.sage files in the first place or should I start out writing *.py scripts and use "from sage.all import *" and prepend all the sage-functions I use with "sage.all."?rtrwalker (Nov 17 '11)Also, I wonder if sometimes it does create walk.py in the proper directory. At least, I have some .py files I didn't create that are in the same directory as the .sage files I use for my research. But I always have to call them with the full /path/to/file.sage, so maybe that makes a difference as opposed to rtwalker's use case...kcrisman (Nov 17 '11)@rtwalker: I think that to start off, the advantage of the .sage files is that you get a quick start and can see what happens. Then when you make .py files out of them, you can later (usually by trial and error) figure out what you actually need to important, rather than doing the nasty import * trick. But everyone has a different preferred work flow, it's up to what makes you comfortable and productive.kcrisman (Nov 17 '11)@John Palmieri after repeating my procedure I still could not find walk.py in the directory that you suggested (all there was was an empty 'interface' directory. Regardless, with your sage --preparse suggestion I can force sage to make me a walk.py file. Thanksrtrwalker (Nov 17 '11) see 2 more comments

[hide preview]