octans / pythonpractice Goto Github PK
View Code? Open in Web Editor NEWPython practice works
Python practice works
Traceback (most recent call last):
File "D:/workspace/Python/spiderWanghong/huajiao.py", line 137, in
class BoseModel(Model):
File "D:/workspace/Python/spiderWanghong/huajiao.py", line 138, in BoseModel
conn = Mysql(host='127.0.0.1', unix_socket='/tmp/mysql.sock', user='root', passwd='123456', db='wanghong', charset='utf8')
File "D:\workspace\Python\spiderWanghong\mysql.py", line 14, in new
cls.connect(**params)
File "D:\workspace\Python\spiderWanghong\mysql.py", line 22, in connect
cls.conn = pymysql.connect(**params)
File "D:\IDE\Python\Python36\lib\site-packages\pymysql_init_.py", line 90, in Connect
return Connection(*args, **kwargs)
File "D:\IDE\Python\Python36\lib\site-packages\pymysql\connections.py", line 706, in init
self.connect()
File "D:\IDE\Python\Python36\lib\site-packages\pymysql\connections.py", line 903, in connect
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
AttributeError: module 'socket' has no attribute 'AF_UNIX'
Process finished with exit code 1
我的代码在这里
用的是python3.6,抓取主播信息时老是报URLError错误,但是却捕获不了,能帮忙看一下吗
没看到你在mysql.py这个文件中定义self.tbl就直接在48行使用了。
另外,Model类中的select方法,没有必要对例如select_str = '123, abc' 中的逗号进行处理吧,可以直接用select 123, abc from tbl。为什么非要用select '123', 'abc' from tbl呢?
请大神指点一二,谢谢!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.