Files
ailearning/docs/da/098.md
2020-10-19 21:08:55 +08:00

44 lines
541 B
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 生成编译注释
In [1]:
```py
%%file fib_orig.pyx
def fib(n):
a,b = 1,1
for i in range(n):
a,b = a+b, a
return a
```
```py
Writing fib_orig.pyx
```
In [2]:
```py
!cython -a fib_orig.pyx
```
在浏览器中打开 `fib_orig.html` 可以查看内容,`windows` 下打开网页使用:
In [3]:
```py
!start fib_orig.html
```
`linux` 下使用:
```py
open fib_orig.html
```
其界面可能如图所示: ![界面](fib_orig.png)
点击某一行可以查看该 `Python` 代码对应的 `C` 代码。