Devam Ediyor

PyCurl a CSV file

I get an error:

Traceback (most recent call last):

File "[url removed, login to view]", line 34, in <module>

[url removed, login to view]()

[url removed, login to view]: (7, 'Failed connect to ???.???.???.???; No route to host')

whereby ???.???.???.??? is an IP address, but not replying.

Instead of failing, I want it to just report the bad IP and continue reading the csv file.

The code is below:

import sys

import pycurl

import csv

with open('[url removed, login to view]', 'rb') as csvfile:

suspects = [url removed, login to view](csvfile, delimiter=' ', quotechar='|')

for row in suspects:

a = str(row)

b = a[2:]

c = len(b) -2

d = b[0:c]

names = ['user1', 'user2', 'user3']

passwords = ['pass1', 'pass2', 'pass3']

num = 0

if num < 3:

name = names[num]

pwd = passwords[num]

address = d

class Test:

def __init__(self):

[url removed, login to view] = ''

def body_callback(self, buf):

[url removed, login to view] = [url removed, login to view] + buf

t = Test()

c = [url removed, login to view]()

[url removed, login to view]([url removed, login to view], c.HTTPAUTH_ANY)

[url removed, login to view]([url removed, login to view], 'http://' + address + ':3011')

[url removed, login to view]([url removed, login to view], '{}:{}'.format(name, pwd))

[url removed, login to view]([url removed, login to view], t.body_callback)

[url removed, login to view]()

[url removed, login to view]()

num = num + 1

data = [url removed, login to view]

if data[18:20] == 'OK':

print "valid login: ", address, " ", name, " ", pwd

Beceriler: Python, Yazılım Mimarisi, Web Güvenliği

Daha fazlasını görün: failed connect route host, data str, num py, curl software, code sys, str, row b, RB, len, import csv, file reader, csv file, php curl http code, route software, curl csv, address name format, curl error code, php print error, php curl file contents, line csv, import csv address, php reader csv, php curl class, csv call, csv file code

İşveren Hakkında:
( 4 değerlendirme ) Tecumseh, United States

Proje NO: #6491826

Seçilen:

TarasKuzyo

Hi! I can provide you with solution right now. You just have to catch the exception. It will take 3 more lines of code.

1 gün içinde 20$ USD
(44 Değerlendirme)
5.0

2 freelancers are bidding on average $27 for this job

rajeshsonisl

Hello Chris, With 99% completion rate, 700 successfully completed projects, and a 5.00 reputation (maximum possible, 5.0) (Yes, not even 4.99 average rating, can be verified on my profile page !!)... you can never g Daha fazlası

1 gün içinde 34$ USD
(42 Değerlendirme)
6.5