安裝: 雙擊Anaconda3-5.0.0-Windows-x86_64.exe文件
根盤下建一個anaconda文件夾
添加環境變量 E:\anaconda
E:\anaconda\Scripts
可視化頁面Launch啓動 內容保存桌面,這個服務器找不到其它盤
或者小黑屏啓動 輸入命令:
(base) C:\Users\xiaoyu>jupyter notebook
first.ipynb //第一個程序
print("hello world")
快捷鍵b新建cell(輸入框) //點擊cell讓其變爲藍色 下方新建cell 上方a
運行代碼快捷鍵 Ctrl + Enter
雙擊D(d)刪除當前cell
幫助信息:
help(len)
len?
shift + tab
def add(a,b): //自定義函數
print(a+b)
"""
加法運算
"""
add? //顯示信息
add?? //源代碼也會顯示
相對路徑與絕對路徑運行代碼:
%run "./111.py" #最好使用雙引號
%run "C:\Users\xiaoyu\Desktop\shuju\day-01\1-IPython\xiaoyu\111.py"
#查看代碼運行時間
def cc(num):
if num == 1:
return 1
return num*cc(num-1)
%time cc(5)
#查看代碼平均運行時間
%timeit cc(6)
兩個%測試多行代碼時間
%who //查看當前會話所有變量與函數
%whos // 詳細信息
%who_is //返回列表
Windows版本 不支持Linux命令
!echo("haha") //可以打印
更多魔法指令
%lsmagic