This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
app = Flask(__name__) | |
@app.route("/" , methods=['GET']) | |
def index(): | |
return "hello world", 200 | |
if __name__=='__main__': | |
app.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#必須要import request,才可以在下面的程式碼當中抓到get or post的參數 | |
from flask import Flask,request | |
import json | |
import requests | |
app = Flask(__name__) | |
@app.route("/" ,methods=['GET']) | |
def hello(): | |
if request.args.get('hub.mode')=='subscribe' and request.args.get('hub.challenge'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#encoding=UTF-8 | |
""" | |
Datetime:2016/12/17 | |
Author:Ethan.Y | |
Purpose: | |
1.練習使用Line Messaging API | |
2.練習閱讀官方的Document | |
Functions: | |
1.收到訊息之後回復 | |
2.若收到的訊息當中還有(掰掰)字串,則回應特定內容 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from oauth2client.service_account import ServiceAccountCredentials | |
from httplib2 import Http | |
from apiclient.discovery import build | |
""" | |
Reference: | |
1.Google OAuth 2.0 for Service Account | |
2..OAuth 2.0 API scope:https://developers.google.com/identity/protocols/googlescopes#sheetsv4 | |
3..Install python api library:https://developers.google.com/api-client-library/python/start/installation | |
4..Google Sheet api:https://developers.google.com/resources/api-libraries/documentation/sheets/v4/python/latest/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup as bs | |
#form的action網址 | |
url = 'https://docs.google.com/forms/d/e/1FAIpQLSfG0Jrb1XB0_6bnStQqI3LTh1vJxzNf92X38O9n9gINR3pERQ/formResponse' | |
r = requests.Session() | |
res = r.get('https://docs.google.com/forms/d/e/1FAIpQLSfG0Jrb1XB0_6bnStQqI3LTh1vJxzNf92X38O9n9gINR3pERQ/viewform') | |
soup = bs(res.content,'html.parser') | |
inputlist = soup.find_all('input') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#encoding=UTF-8 | |
""" | |
Author:Ethan Yang | |
Datetime:2016/12/29 | |
Purpose: | |
1.對話是經濟?! | |
2.利用Line當作輸入指令的窗口。 | |
3.記帳。 | |
4.查詢單字 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
</head> | |
<body > | |
<input type='file' onchange='openFile(event)'><br> | |
<div id='output'> | |
</div> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
</head> | |
<body> | |
<input type="file" id="files" name="files" multiple /> | |
<div id="output"> | |
</div> | |
<script> | |
function openFile(event){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import Tkinter as tk | |
import io | |
from PIL import Image,ImageTk | |
class Mainapplication(tk.Frame): | |
def __init__(self,master=None): | |
tk.Frame.__init__(self,master) | |
self.pack() | |
self.createwidget() |