[Tutor] Writing back to same CSV in the next column

Nym City nymcity at yahoo.com
Mon Aug 3 01:13:49 CEST 2015


Hello,
Below is my program where I am reading a list of IPs from a CSV file and running it through the socket module. The result of the computation is stored in a variable named ResolvedAddresses. However, there are some that are not resolved and for those there is an exception.
The task that I am trying to complete now is taking the output of the ResolvedAddresses and the content of the exception and write is back out to the same CSV file where the data is originally imported from. Ideally, I would like this new information to be in the column B and match with column A.
Thank you in advance. And please let me know if what I am trying to accomplish is not clear and I'll try to explain it better.

Here is the code: https://bpaste.net/show/01a412f72fa1

 Thank you.


More information about the Tutor mailing list