import sys import codecs import traceback import requests import re import pandas as pd import random import urllib import json import gspread import datetime from gspread_pandas import Spread, Client from oauth2client.service_account import ServiceAccountCredentials import os import redis r = redis.Redis(host='db.ptt.cx', port=6379, db=1,password='choozmo9') js=r.get('innews_sheet') jsobj=json.loads(js) kw=random.choice(jsobj) print(kw['kw']) if os.name == 'nt': py='python' else: py='python3' os.system(py+' general_clickbot.py get --kw="'+kw['kw']+'" --domain=innews.com.tw')