ftputil

Getting EOFError along with exceptions when using ftplib

蓝咒 提交于 2020-01-04 09:04:04
问题 I'm looking into using ftplib (and possibly ftputil) for doing some automated FTP file syncing. I have a couple of servers to test this against at the moment, but, whilst I'm having a successful conversation with both servers, I get EOFError-s with each error reply. For example: if I try to log in with an incorrect user/pass, I will get the 530 response with everything... but I also get an EOFError; if I login with a correct user/pass or try to dir() after doing so etc., I get no EOFError. It

Zipping files in python

懵懂的女人 提交于 2019-12-05 20:16:14
问题 My Program runs smoothly but I want my files from ftp to be zip in my local drive My Problem : Only 1 file is being zipped after calling my main() function Here's my code: main import os import upload import download import zipfile import ConfigParser import ftputil def main(): #create a folder Temp on d drive for later use path = r'D:\Temp' os.mkdir(path) #parse all the values at config.ini file config = ConfigParser.ConfigParser() config.readfp(open('config.ini')) server = config.get('main'

Zipping files in python

夙愿已清 提交于 2019-12-04 02:43:34
My Program runs smoothly but I want my files from ftp to be zip in my local drive My Problem : Only 1 file is being zipped after calling my main() function Here's my code: main import os import upload import download import zipfile import ConfigParser import ftputil def main(): #create a folder Temp on d drive for later use path = r'D:\Temp' os.mkdir(path) #parse all the values at config.ini file config = ConfigParser.ConfigParser() config.readfp(open('config.ini')) server = config.get('main', 'Server') username = config.get('main', 'Username') password = config.get('main', 'Password') uploads

cv2.videocapture.read() does not return a numpy array

随声附和 提交于 2019-11-30 04:19:56
问题 I have this code trying to capture a frame from my webcam on raspberry pi, and saving it as an image. I use opencv 2, but I get strange errors when I run the code.. import time import sys from subprocess import call import cv2 cam = cv2.VideoCapture() while True: cam.open(-1) image = cam.read() cv2.imwrite("current.jpeg",image) time.sleep(10); This is what the program returns: VIDIOC_QUERYMENU: Invalid argument VIDIOC_QUERYMENU: Invalid argument VIDIOC_QUERYMENU: Invalid argument VIDIOC