我想用 Python 的 ftplib 客户端指定端口(而不是默认端口 21).
I would like to specify the port with Python's ftplib client (instead of default port 21).
代码如下:
from ftplib import FTP
ftp = FTP('localhost') # connect to host, default port
有没有一种简单的方法可以指定备用端口?
Is there an easy way to specify an alternative port?
>>> from ftplib import FTP
>>> HOST = "localhost"
>>> PORT = 12345 # Set your desired port number
>>> ftp = FTP()
>>> ftp.connect(HOST, PORT)
这篇关于Python ftplib - 指定端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
为什么我不能插入 Python 列表?Why I cannot make an insert to Python list?(为什么我不能插入 Python 列表?)
在 DataFrame 的开头(最左端)插入一列Insert a column at the beginning (leftmost end) of a DataFrame(在 DataFrame 的开头(最左端)插入一列)
Python psycopg2 没有插入到 postgresql 表中Python psycopg2 not inserting into postgresql table(Python psycopg2 没有插入到 postgresql 表中)
list extend() 索引,不仅将列表元素插入到末尾list extend() to index, inserting list elements not only to the end(list extend() 索引,不仅将列表元素插入到末尾)
如何使用 list.insert 将 Python 中的元素添加到列表How to add element in Python to the end of list using list.insert?(如何使用 list.insert 将 Python 中的元素添加到列表末尾?)
TypeError:“浮动"对象不可下标TypeError: #39;float#39; object is not subscriptable(TypeError:“浮动对象不可下标)