1 | initial version |

Here is what worked for me. First I create a file:

/home/mike/cython.spyx

with the following contents:

cdef class c_class:

```
cdef int number
def __init__(self, n):
self.number = n
cpdef show(self):
print('The number was: %s' %self.number)
```

Then I start up sage:

sage: version()

'Sage Version 4.5.1, Release Date: 2010-07-19'

sage: load '/home/mike/cython.spyx'

Compiling /home/mike/cython.spyx...

sage: instance = c_class(5)

sage: instance.show()

The number was: 5

-- I hope this is readable. This is the first question I've tried to answer and I'm having a little trouble with the formatting :-)

-Mike

2 | No.2 Revision |

Here is what worked for me. First I create a file:

/home/mike/cython.spyx

with the following contents:

cdef class c_class:

```
cdef class c_class:
cdef int number
```~~ ~~ def __init__(self, n):
self.number = n
~~ ~~ cpdef show(self):
print('The number was: %s' %self.number)

Then I start up sage:

`sage: `~~version() ~~version()
'Sage Version 4.5.1, Release Date: ~~2010-07-19'~~

2010-07-19'
sage: load ~~'/home/mike/cython.spyx'~~

'/home/mike/cython.spyx'
Compiling ~~/home/mike/cython.spyx...~~

/home/mike/cython.spyx...
sage: instance = ~~c_class(5)~~

c_class(5)
sage: ~~instance.show()~~

instance.show()
The number was: ~~5~~

5

-- I hope this is readable. This is the first question I've tried to answer and I'm having a little trouble with the formatting :-)

-Mike

3 | No.3 Revision |

Here is what worked for me. First I create a file:

/home/mike/cython.spyx

with the following contents:

```
cdef class c_class:
cdef int number
def __init__(self, n):
self.number = n
cpdef show(self):
print('The number was: %s' %self.number)
```

Then I start up sage:

```
sage: version()
'Sage Version 4.5.1, Release Date: 2010-07-19'
sage: load '/home/mike/cython.spyx'
Compiling /home/mike/cython.spyx...
sage: instance = c_class(5)
sage: instance.show()
The number was: 5
```

-- I hope this is readable. This is the first question I've tried to answer and I'm having a little trouble with the formatting :-)

-Mike

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.