Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.4k views
in Technique[技术] by (71.8m points)

python写的ftp客户端,请问为什么会出现这样的错误?

ftp客户端python


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

这个啊,我来示范一个给你看看

>>> import requests 
>>> requests("123")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
>>> 
>>> from os import path
>>> path()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable

看明白了吧,我导入的是requests、path都是模块,我当方法用了,就报这个错了,我应该这样用才对

>>> import requests
>>> requests.get("http://baidu.com")
<Response [200]>

调用模块中的方法,你看看你的是不是这样。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...