[sage-support] Re: How can I import a .py -file to Sage?

2009-02-05 Thread Mike Hansen

Hello,

On Thu, Feb 5, 2009 at 2:45 PM, Fall In Love with Sage
cs.losi...@gmail.com wrote:
 I tried the code unsuccessfully:
   a = open([x.replace(',',' ').split() for x in open('/Applications/
 sage/test.py').readlines()]
   a

You can do the following to load a .py file into a Sage session:

sage: load /Applications/sage/test.py

If you want to have the file automatically reloaded when you make
changes to it, you can do:

sage: attach /Applications/sage/test.py

--Mike

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sage-support] Re: How can I import a .py -file to Sage?

2009-02-05 Thread Minh Nguyen

Hi,

On Fri, Feb 6, 2009 at 9:45 AM, Fall In Love with Sage
cs.losi...@gmail.com wrote:

 I tried the code unsuccessfully:
   a = open([x.replace(',',' ').split() for x in open('/Applications/
 sage/test.py').readlines()]
   a

 Similarly, the next code too:
   a = open(for x in open('/Applications/sage/test.py').readlines()
   a

In addition to Mike's suggestions, you might also want to read the tutorial at

http://www.sagemath.org/doc/tut/node52.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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How can I import a .py -file to Sage?

2009-02-05 Thread Fall In Love with Sage

Thank you both!

On Feb 6, 12:55 am, Minh Nguyen nguyenmi...@gmail.com wrote:
 Hi,

 On Fri, Feb 6, 2009 at 9:45 AM, Fall In Love with Sage

 cs.losi...@gmail.com wrote:

  I tried the code unsuccessfully:
    a = open([x.replace(',',' ').split() for x in open('/Applications/
  sage/test.py').readlines()]
    a

  Similarly, the next code too:
    a = open(for x in open('/Applications/sage/test.py').readlines()
    a

 In addition to Mike's suggestions, you might also want to read the tutorial at

 http://www.sagemath.org/doc/tut/node52.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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---