import

425 views
Skip to first unread message

Mikie

unread,
Oct 12, 2009, 3:58:00 PM10/12/09
to sage-support
My Python script is getting very large. The html pages I am creating
are all class defs.
Can I save the defs in a text file then import them? If so where do I
put them. Isn't Sage just one large bounce of Python files?

Please, excuse my lack of Python/Sage knowledge. Six months ago I
couldn't spell Sage, Linux, Python.

Try my server (no error trapping.)

http://pirsqr.com:7316 or http://pirsqr.com:2713

Thanx

georg grafendorfer

unread,
Oct 13, 2009, 7:58:51 AM10/13/09
to sage-support
Hi Mikie,

put the file with your class definitions (let's say class.py) in
whatever directory (let's say /home/mikie/mydir) and add the path of
this directory to the SAGE_PATH environment variable,
you can do this for example by adding the line

export SAGE_PATH=${SAGE_PATH}:/home/mikie/mydir

to the files ~/.bash_profile and ~/.bashrc in your home directory (~
= /home/mikie),

then restart the shell from where you are invoking sage,
and it should work, just type

import class

at the sage command line,


btw you can do the same for your system python installation, the
corresponding environment variable is then PYTHONPATH,

Georg

Reply all
Reply to author
Forward
0 new messages