【教學】登入Raspberry PI(RASPBIAN)測試python與網路設定








※本篇內文資訊參考如下※



- -

※更新文章日期: 2016-12-26










OS:RASPBIAN
帳號:pi
密碼:raspberry
進入python
就輸入python即可
出現>>>即進入python
測試python
輸入print Hello, world“會出現Hello, world
輸入1+1會出現2
設定靜態IP 及 DNS
編輯網路設定檔
sudo nano /etc/network/interfaces
把原本的設定DHCP給MARK掉(前面加#變成註解,不執行)
#iface eth0 inet dhcp
下方填上IP資訊
iface eth0 inet static
address 192.168.0.100 
netmask 255.255.255.0
gateway 192.168.0.1
然後按Ctrl+X離開並選擇儲存
sudo nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.0.149
netmask 255.255.0.0
gateway 192.168.0.1
network 192.168.0.0
broadcast 192.168.0.255
DNS設定,才能聯外網
一樣用管理員權限開啟文字編輯器來編輯設定檔
設定檔位置/etc/resolv.conf

sudo nano /etc/resolv.conf
nameserver 208.67.222.222
nameserver 208.67.220.220
將DNS設定後一樣按ctrl+X離開並選擇儲存








-

-