473,385 Members | 1,834 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,385 software developers and data experts.

Re: How do I create user-defined warnings?

2008/6/18 Clay Hobbs <cl**@lakeserv.net>:
I already know how to make user-defined exceptions, like this one:

class MyException(Exception):
pass

But for a module I'm making, I would like to make a warning (so it just
prints the warning to stderr and doesn't crash the program). I have
tried this:

class MyWarning(Warning):
pass

And it behaves like a normal error. Please help me, I can't figure out
what I'm doing wrong.
Use 'warnings' module.
http://docs.python.org/lib/module-warnings.html
>
--
Ratfink

--
http://mail.python.org/mailman/listinfo/python-list


--
Wbr, Andrii Mishkovskyi.

He's got a heart of a little child, and he keeps it in a jar on his desk.
Jun 27 '08 #1
0 729

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

Similar topics

2
by: Keith Jakobs, MCP | last post by:
Greetings: I had seen several posts around the Internet about this issue from a few months back, but have been unable to find a resolution ... I have a user who is trying to get started with...
0
by: Renato Neves | last post by:
The following code is working fine, i can create the user in the Active Directory and "enable" it. My problem is that, when i'm trying to authenticate him, i can't get to work!! The user and pass...
10
by: ibm_97 | last post by:
Hi, all I'm new to DB2 world. DB2 8.1 enterprise on Win XP. Installation (typical method) is fine. I log in as 'abc' user (admin user) to do the installation. Now I have 'db2admin' user. ...
3
by: MLH | last post by:
I was running the following code while logged in as a user belonging only to the Users group. Set usrNew = .CreateUser(Me!UserID) 'The user ID is in a control on the form usrNew.PID =...
4
by: I_AM_DON_AND_YOU? | last post by:
There is one more problem I am facing but didn't get the solution. In my Setup Program I am not been able to create 2 things (when the program is intalled on the client machine ) : (1) create...
0
by: richb330 | last post by:
Hi, I have code from the msdn to crate a user in an AD domain. I have set the code and changed the necessary parameters for the ldap queries but was wondering how i can execute this code on a...
6
by: Philip Wagenaar | last post by:
What is the best way to create a local user on the machine with administrator rights? I have problems with my code on machines that have password policy. The problem is that when the user is...
5
by: Michael | last post by:
Hello, I've created an ASP web page where users in our organization can create Active Directory computer accounts. The web page is running on a Server 2003 SP1 IIS 6 installation. The...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
3
by: sanghavi | last post by:
how to create a set up project in vb.net..how to run an application on a different machine
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.