Socket library

See this post. There is a code snippet there about sending ASCII string characters over Ethernet with some Python coding. You could probably use that to do what you want.