SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Let’s use LineBot
檔案下載
Python 虛擬環境
● python 虛擬環境功能
● 每個專案中建立個別的虛擬環境,彼此之間互不干擾
Python 虛擬環境
好可怕qq
Python 虛擬環境
安裝建立虛擬環境的套件
--pip install virtualenv
Python 虛擬環境
使用安裝好的套件建立虛擬環境
-- virtualenv [你建立的虛擬環境名稱]
Python 虛擬環境
我們要進到虛擬環境囉
了解一下檔案位置吧(ex:C:Usersminni)
Python 虛擬環境
找到執行虛擬環境的執行檔
Python 虛擬環境
C:UsersminniLieBotTestScripts
-- cd C:UsersminniLieBotTestScripts
-- 由c轉d: d:
Python 虛擬環境
Mac的指令:
• cd /Users/你的電腦名稱/Documents #到你要的資料夾
• mkdir newfolder_name #新增資料夾
• cd newfolder_name #進到資料夾
• python3 -m venv name_env #建立虛擬環境
• cd /Users/你的電腦名稱/Documents/newfolder_name #到有
虛擬環境的資料夾
• source name_env/bin/activate #開啟虛擬環境
Python 虛擬環境
我們再來pip list (麻煩再幫我開一個cmd進到虛擬環境)
讓我們的一頁網站動起來
讓我們的一頁網站動起來
-- d:
-- cd D:LineBotTestGDSC_Weather-main
-- python app.py(我建置網站的python檔)
讓我們的一頁網站動起來
哭了,怎麼沒有套件…趕快安裝起來
讓我們的一頁網站動起來
哭了,怎麼沒有套件…趕快安裝起來
讓我們的一頁網站動起來
--再來 python app.py
--達成成就:獲得網址http://127.0.0.1:5000
--啥是127.0.0.1 ??
讓我們的一頁網站動起來
http://140.115.XXX.XXX
https://abcd.test....
讓我們的line bot動起來
-- 再次回到那個檔案目錄執行main.py(line bot)
-- pip install line-bot-sdk
讓我們的line bot動起來
-- line bot 基本概念
讓我們的line bot動起來
--什麼是api
● API (Application Programming Interface) 在維基百
科上的介紹是「應用程式介面」,定義多個軟體之間的
互動及呼叫或請求。
● 其目的在於「不必了解對方的技術與邏輯即可加速開發
的共識」。
讓我們的line bot動起來
詳細api 使用方法請參閱官方文件
https://developers.line.biz/en/
讓我們的line bot動起來
把它們貼到vscode的main.py(裡面寫linebot的code)
讓我們的line bot動起來
• 完蛋了,我們需要https協定的domain
• 我們現在為http://127.0.0.1:80
• 透過ngrok進行轉換
讓我們的line bot動起來
下載ngrok:https://ngrok.com/download
讓我們的line bot動起來
--ngrok http 80
讓我們的line bot動起來
-- (https://你的網址)/callback -->使用callback router
讓我們的line bot動起來
記得將我們一頁網站的qrcode改掉喔~
然個地方都可以自己動態修改呦
使用中央氣象局api
• https://opendata.cwb.gov.tw/dist/opendata-
swagger.html#/%E9%A0%90%E5%A0%B1/get_v1_rest_datastor
e_F_C0032_001

Weitere ähnliche Inhalte

Ähnlich wie LineBot.pptx

如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)
如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)
如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)Yanwei Liu
 
認識那條鯨魚 Docker 初探
認識那條鯨魚   Docker 初探認識那條鯨魚   Docker 初探
認識那條鯨魚 Docker 初探仲昀 王
 
做卓有成效的程序员
做卓有成效的程序员做卓有成效的程序员
做卓有成效的程序员Lv Jian
 
Mininet Learning Guide(Mininet 学习指南)
Mininet Learning Guide(Mininet 学习指南)Mininet Learning Guide(Mininet 学习指南)
Mininet Learning Guide(Mininet 学习指南)呈 李
 
Python和web开发
Python和web开发Python和web开发
Python和web开发moonbingbing
 
100902 wm4wps-py-webdev
100902 wm4wps-py-webdev100902 wm4wps-py-webdev
100902 wm4wps-py-webdevZoom Quiet
 
該怎麼樣(認真的)部署你的 Python Web 應用程式?
該怎麼樣(認真的)部署你的 Python Web 應用程式?該怎麼樣(認真的)部署你的 Python Web 應用程式?
該怎麼樣(認真的)部署你的 Python Web 應用程式?Andy Dai
 
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來Shengyou Fan
 
2 Python开发工具链
2 Python开发工具链2 Python开发工具链
2 Python开发工具链March Liu
 
Python包管理工具介绍
Python包管理工具介绍Python包管理工具介绍
Python包管理工具介绍Young King
 
版本控制 使用Git & git hub
版本控制   使用Git & git hub版本控制   使用Git & git hub
版本控制 使用Git & git hub維佋 唐
 
Software Engineer Talk
Software Engineer TalkSoftware Engineer Talk
Software Engineer TalkLarry Cai
 
这年头,你只需要懂Node webkit
这年头,你只需要懂Node webkit这年头,你只需要懂Node webkit
这年头,你只需要懂Node webkitLainZQ
 
軟體組裝心得分享
軟體組裝心得分享軟體組裝心得分享
軟體組裝心得分享Wen Liao
 
Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)Yiwei Ma
 
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & WindowsChu-Siang Lai
 

Ähnlich wie LineBot.pptx (20)

如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)
如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)
如何幫樹莓派安裝常用的Python套件(How to Install Python Package on Raspberry Pi)
 
認識那條鯨魚 Docker 初探
認識那條鯨魚   Docker 初探認識那條鯨魚   Docker 初探
認識那條鯨魚 Docker 初探
 
做卓有成效的程序员
做卓有成效的程序员做卓有成效的程序员
做卓有成效的程序员
 
Mininet Learning Guide(Mininet 学习指南)
Mininet Learning Guide(Mininet 学习指南)Mininet Learning Guide(Mininet 学习指南)
Mininet Learning Guide(Mininet 学习指南)
 
Linuxguide4f2e
Linuxguide4f2eLinuxguide4f2e
Linuxguide4f2e
 
LinuxGuide4F2E
LinuxGuide4F2ELinuxGuide4F2E
LinuxGuide4F2E
 
Python和web开发
Python和web开发Python和web开发
Python和web开发
 
100902 wm4wps-py-webdev
100902 wm4wps-py-webdev100902 wm4wps-py-webdev
100902 wm4wps-py-webdev
 
該怎麼樣(認真的)部署你的 Python Web 應用程式?
該怎麼樣(認真的)部署你的 Python Web 應用程式?該怎麼樣(認真的)部署你的 Python Web 應用程式?
該怎麼樣(認真的)部署你的 Python Web 應用程式?
 
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
 
Django step0
Django step0Django step0
Django step0
 
Python in vir
Python in virPython in vir
Python in vir
 
2 Python开发工具链
2 Python开发工具链2 Python开发工具链
2 Python开发工具链
 
Python包管理工具介绍
Python包管理工具介绍Python包管理工具介绍
Python包管理工具介绍
 
版本控制 使用Git & git hub
版本控制   使用Git & git hub版本控制   使用Git & git hub
版本控制 使用Git & git hub
 
Software Engineer Talk
Software Engineer TalkSoftware Engineer Talk
Software Engineer Talk
 
这年头,你只需要懂Node webkit
这年头,你只需要懂Node webkit这年头,你只需要懂Node webkit
这年头,你只需要懂Node webkit
 
軟體組裝心得分享
軟體組裝心得分享軟體組裝心得分享
軟體組裝心得分享
 
Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)
 
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
 

Mehr von NCUDSC

221013 GDSC Kotlin Basics.pptx
221013 GDSC Kotlin Basics.pptx221013 GDSC Kotlin Basics.pptx
221013 GDSC Kotlin Basics.pptxNCUDSC
 
GDSC NCU Flutter
GDSC NCU FlutterGDSC NCU Flutter
GDSC NCU FlutterNCUDSC
 
讓你的人工智慧更智慧 - Developer Student Clubs.pptx
讓你的人工智慧更智慧 - Developer Student Clubs.pptx讓你的人工智慧更智慧 - Developer Student Clubs.pptx
讓你的人工智慧更智慧 - Developer Student Clubs.pptxNCUDSC
 
Laravel II - Developer Student Clubs NCU.pdf
Laravel II - Developer Student Clubs NCU.pdfLaravel II - Developer Student Clubs NCU.pdf
Laravel II - Developer Student Clubs NCU.pdfNCUDSC
 
20220316 laravel I
20220316 laravel I20220316 laravel I
20220316 laravel INCUDSC
 
Gdsc is back!
Gdsc is back!Gdsc is back!
Gdsc is back!NCUDSC
 
Artificial intelligence in laboratory medicine clinical decision support-gd...
Artificial intelligence in laboratory medicine   clinical decision support-gd...Artificial intelligence in laboratory medicine   clinical decision support-gd...
Artificial intelligence in laboratory medicine clinical decision support-gd...NCUDSC
 
GDSC intro
GDSC introGDSC intro
GDSC introNCUDSC
 
NLP補充
NLP補充NLP補充
NLP補充NCUDSC
 
Docker
DockerDocker
DockerNCUDSC
 
Big Query
Big QueryBig Query
Big QueryNCUDSC
 
Forensics 101 的副本
Forensics 101 的副本Forensics 101 的副本
Forensics 101 的副本NCUDSC
 

Mehr von NCUDSC (12)

221013 GDSC Kotlin Basics.pptx
221013 GDSC Kotlin Basics.pptx221013 GDSC Kotlin Basics.pptx
221013 GDSC Kotlin Basics.pptx
 
GDSC NCU Flutter
GDSC NCU FlutterGDSC NCU Flutter
GDSC NCU Flutter
 
讓你的人工智慧更智慧 - Developer Student Clubs.pptx
讓你的人工智慧更智慧 - Developer Student Clubs.pptx讓你的人工智慧更智慧 - Developer Student Clubs.pptx
讓你的人工智慧更智慧 - Developer Student Clubs.pptx
 
Laravel II - Developer Student Clubs NCU.pdf
Laravel II - Developer Student Clubs NCU.pdfLaravel II - Developer Student Clubs NCU.pdf
Laravel II - Developer Student Clubs NCU.pdf
 
20220316 laravel I
20220316 laravel I20220316 laravel I
20220316 laravel I
 
Gdsc is back!
Gdsc is back!Gdsc is back!
Gdsc is back!
 
Artificial intelligence in laboratory medicine clinical decision support-gd...
Artificial intelligence in laboratory medicine   clinical decision support-gd...Artificial intelligence in laboratory medicine   clinical decision support-gd...
Artificial intelligence in laboratory medicine clinical decision support-gd...
 
GDSC intro
GDSC introGDSC intro
GDSC intro
 
NLP補充
NLP補充NLP補充
NLP補充
 
Docker
DockerDocker
Docker
 
Big Query
Big QueryBig Query
Big Query
 
Forensics 101 的副本
Forensics 101 的副本Forensics 101 的副本
Forensics 101 的副本
 

LineBot.pptx