473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

smptlib frustration!

Joe
Ok I have written a perfectly well working script that uses smptlib
module to email myself if the script ended in success or failure.
However, this module automatically outputs the results to the console
to show the status of the connection/send/recieve etc... This is a
big problem for me. I am trying to run this script from Backup Exec
as a pre-processing job. This causes my script to always fail because
Backup Exec pre-processing jobs can not output to a console! What am
I to do? Is there a way to stop this module from outputing the status
to the console without having to actually modify the standard module?
Thanks!
Jul 18 '05 #1
1 1455
Joe wrote:
Ok I have written a perfectly well working script that uses smptlib
module to email myself if the script ended in success or failure.
However, this module automatically outputs the results to the console
to show the status of the connection/send/recieve etc... This is a
big problem for me. I am trying to run this script from Backup Exec
as a pre-processing job. This causes my script to always fail because
Backup Exec pre-processing jobs can not output to a console! What am
I to do? Is there a way to stop this module from outputing the status
to the console without having to actually modify the standard module?


If you must do this from within the program rather than being
able to do the simplest thing, which is to use redirection to
dump the output to nowhere... (/dev/null or >nil depending on
your OS, if it's Linux or Win32)... then you can use something
like this:

import sys
class Sink:
def write_null(self, *pargs):
pass
sys.stdout = sys.stderr = Sink()

There may be a simplification possible, but it's been a while since
I've had to do that...

-Peter
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mary E. Hill | last post by:
Compared to the other posts here, this ought to be a cakewalk for you guys;) I'm trying to make a form in a pdf doc that will mail to me. I'm trying to use the following script: this.mailForm...
10
by: Frog | last post by:
Hi, i'm not a programmer so I have a very stupid question. I'm trying to make a practical script. I need to run an executable program in it but i can't get it to work. Maybe someone here can...
9
by: insomniux | last post by:
Hi, I am having a problem with formatting the default value of a date field. It has been discussed earlier in many topics, but still I cannot solve the problem. What's happening: I have various...
11
by: Lloyd Sheen | last post by:
Why oh why can I not edit and continue??? VS 2005 Pro. Multi project solution. All solutions set to debug. But I cannot edit the source when debugging. Any ideas??
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.