Solved

Using Blat in Python

Posted on 2010-09-15
3
1,552 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

A set of related code is known to be a Module, it helps us to organize our code logically which is much easier for us to understand and use it. Module is an object with arbitrarily named attributes which can be used in binding and referencing. …
Dictionaries contain key:value pairs. Which means a collection of tuples with an attribute name and an assigned value to it. The semicolon present in between each key and values and attribute with values are delimited with a comma.  In python we can…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
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…

707 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