def createContact(record):
  """
    Create a partially populated Contact record, associated with the 
    Account ("Company") specified in the Excel record.
  """
  global importSheet, importRow
  contact              = sf.generateObject('Contact')
  contact.AccountId    = record['AccountId']
  contact.FirstName    = record['First Name']
  contact.LastName     = record['Last Name']
  contact.Title        = record['Title']
  contact.Email        = record['Email']
  contact.Description  = record['Notes']
  result               = sf.create(contact)
  
  if result.success != True:
    msg = "Error: Can't create Contact record for %s, result was %s" % (str(record), result)      
    raise ImportError(msg, importSheet, importRow)
    
  print "New Contact record for %s, %s, Id = %s" \
    % (contact.LastName, contact.FirstName, result.id)

  return result

    Create a partially populated Contact record, associated with the 
    Account ("Company") specified in the Excel record.
  
recipes/Python/577550_Custom_import_script/recipe-577550.py