Solved

Using Blat in Python

Posted on 2010-09-15
3
1,505 Views
Last Modified: 2012-05-10
Does anyone have an example of using Blat in a Python script. I would like to get a fail or success notify when the script finishes. I'm sure there are better alternatives but with my limited skill i figured blat would be the easiest to master.

thanks,
0
Comment
Question by:huskeraider
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
-Richard- earned 250 total points
ID: 33685844
Blat allows you to send emails directly from the ommand line, so for a simple success notification, the following should work from within Python:

import os
os.system('blat.exe - -f from@example.com -to to@somewhere.com -s Subject -body "Success!" -server smtp.example.com:25 -u username -pw password ')

Please note there is also a "subprocss" library which is a more sophisticated way to execute command-line programs, but I sense your needs are rather simple and os.system should suffice.
0
 

Author Comment

by:huskeraider
ID: 33693203
This is just what i needed.

Thanks
0
 

Author Closing Comment

by:huskeraider
ID: 33693219
Outstanding.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sequence is something that used to store data in it in very simple words. Let us just create a list first. To create a list first of all we need to give a name to our list which I have taken as “COURSE” followed by equals sign and finally enclosed …
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question