i have a working python script that checks the vat number of European companies. However checking 20 vat id by typing is not logical. I would like to check vat numbers from a file instead of manual typing every vat ids.
Here is the code:
from suds.client import Client
from urllib import getproxies
from pyfiglet import Figlet
import re
custom_fig = Figlet(font='slant')
print(custom_fig.renderText('VATCheck'))
stringtosplit = raw_input('Enter vat number (like "EE102323452") :')
letters = ''.join(re.findall('([a-zA-Z])', stringtosplit))
numbers = ''.join(re.findall('([0-9])', stringtosplit))
VIES_URL = "http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl"
client = Client(VIES_URL, proxy=getproxies())
response = client.service.checkVat(letters, numbers)
print (response)
How can i achieve to check several vat number from a vat_numbers.txt file?