
python
紫莜星空
java,tcl,oracle,shell,c,e,unix,linux交流
展开
-
python 连接oracle
今天尝试用python连接oracle,各种碰壁,最终还是搞定了主要思路,安装对应版本的cx_Oracle1.上官方网站https://pypi.python.org/pypi/cx_Oracle,下载对应版本的cx_Oracle.2.保证自己有Oracle客户端,没有到官网下载。3.版本和系统位数要对应,oracle和python最好都是32位或64位的,不然你对应版本的cx_O原创 2017-09-24 13:28:11 · 1041 阅读 · 2 评论 -
python灵活连接数据库,返回字典结果
#add by Dob#python 3.6.2#oracle 64位windowsimport cx_Oracle as orclclass OraDao(object): def switch(self): db = {} db['xe']="system/123456@XE" return db[self.db_...原创 2018-03-10 14:56:46 · 2966 阅读 · 0 评论 -
python中的switch块
安装:pip --default-timeout=100 install -U switch from switch import Switchi=1with Switch(i) as case: if case(1): requests_get = requests_get() try: requests_get.getUrl(u...原创 2018-03-18 14:01:31 · 547 阅读 · 0 评论 -
python出现报错Microsoft Visual C++ 14.0 is required
借用外国网友的说法:https://github.com/nodejs/node-gyp/issues/802原创 2018-03-13 21:40:55 · 487 阅读 · 0 评论 -
Scrapy TypeError: 'float' object is not iterable
主要是Twisted版本不兼容,经仔细调试,将报错的这行代码修改:"D:\python3.6.2\lib\site-packages\twisted\internet\base.py", line 276,if timeout: #timeoutList = [] #print(type(timeoutList.append(timeout))) ...原创 2018-03-31 13:09:31 · 832 阅读 · 0 评论 -
python 代理爬种子,保存到MongoDB和json
1.爬虫 dmoz_spider.py#!/usr/bin/env python# -*- coding:utf-8 -*-# Author:donghuiimport scrapyimport refrom urllib.parse import quotefrom tutorial.items import DmozItemclass DmozSpider(scrapy.Sp...原创 2018-03-31 22:00:32 · 7598 阅读 · 1 评论 -
pyinstaller打包人脸识别程序,带界面--过坑
1.fail to execute XXX使用import tracebacktry: import face_recognitionexcept Exception as e: traceback.print_exc(file=open('error.log', 'w+'))发现错误RuntimeError: Unable to open D:\pyth...原创 2018-11-04 18:33:27 · 2074 阅读 · 0 评论