Sometimes its convenient to use the DATA directory, which will be
packaged with the worksheet if you save it (as a .sws file). So for
example you could copy the file to the DATA directory doing something
like:
os.system('cp /full/path/to/list2.txt ' + DATA + 'list2.txt')
and then
f =
Thanks Jason, I'm surprised this never showed up on my radar before.
-Marshall
On Feb 6, 12:45 pm, Jason Grout jason-s...@creativetrax.com wrote:
Marshall Hampton wrote:
Sometimes its convenient to use the DATA directory, which will be
packaged with the worksheet if you save it (as a .sws
Marshall Hampton wrote:
Sometimes its convenient to use the DATA directory, which will be
packaged with the worksheet if you save it (as a .sws file). So for
example you could copy the file to the DATA directory doing something
like:
os.system('cp /full/path/to/list2.txt ' + DATA +
Possibly I'm not understanding your English.
Python can read in any text file, for example csv.
So, the answer to your question seems to be in the
thread you cited.
Also, if you want to know which directory Sageroot is,
type SAGE_ROOT. For example:
sage: SAGE_ROOT
Thank you for your response!
The problem is now in the following codes:
1.
f = open(list2.txt)
l1 = f.readline()
ls1 = l1.split( )
l1
gives:
Traceback (click to the left for traceback)
...
IOError: [Errno 2] No such file or directory: 'list2.txt'
Similarly, the eval
On Thu, Feb 5, 2009 at 2:48 PM, Fall In Love with Sage
cs.losi...@gmail.com wrote:
Thank you for your response!
The problem is now in the following codes:
1.
f = open(list2.txt)
l1 = f.readline()
ls1 = l1.split( )
l1
gives:
Traceback (click to the left for traceback)
...
Thank you!
It works now :)
On Feb 5, 9:54 pm, David Joyner wdjoy...@gmail.com wrote:
On Thu, Feb 5, 2009 at 2:48 PM, Fall In Love with Sage
cs.losi...@gmail.com wrote:
Thank you for your response!
The problem is now in the following codes:
1.
f = open(list2.txt)
l1 =