get_sms_code.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:python 作者: zhouyuyan 项目源码 文件源码
def oracle_connect(self, mobile):
        # ??????
        t = time.strftime('%Y%m%d', time.localtime(time.time()))
        # ??oracle????????
        conn = cx_Oracle.connect('???/??')
        cursor = conn.cursor()
        # ?????SQL???????
        sql = r"select * from (select sms_inf from gwadm.SMSTSMmO where mbl_no = " + "'" + mobile + "'" + " and tx_dt = " + t + " order by OPR_TM desc)where rownum <= 1"
        cursor.execute(sql)
        row = cursor.fetchone()
        cursor.close()
        conn.close()
        code = []
        # ??????????
        for i in row[0]:
            if i.isdigit():
                code.append(i)
        return ''.join(code)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号