473,472 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Re: Suppressing Python wanings globally

2008/10/2 Jean-Paul Calderone <ex*****@divmod.com>:
On Thu, 2 Oct 2008 23:39:29 +0100, Paul Moore <p.*******@gmail.comwrote:
>>
How can I suppress a Python warning globally (i.e., for all instances
of Python I run)? I have a test suite that runs Python via
sys.executable, so the -W flag won't work. A wrapper script doesn't
work, as sys.executable doesn't point to that. And PYTHONSTARTUP is
only for interactive use, so that's no good...

Is there an obvious way I've missed? Surely this is a common issue?

Site-wide configuration is what site customization modules are for.
Check out sitecustomize.py in /usr/lib/python<version>/ or the equivalent
for your platform/installation.
Wow, that was quick! Thanks, that will do. In fact, I only want to do
this for one session, so an environment variable would be more
suitable in theory, but as it's a personal build I can tweak
sitecustomize.py for now and get the result I want.

Thanks,
Paul.
Oct 2 '08 #1
0 620

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

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
23
by: Simon Wittber | last post by:
For the first time, I have been bitten by Python. The below code produces the results: False True when I initially expected the results: False False It took me a while to work out that...
3
by: Paul McGuire | last post by:
I just found out that my favorite UML modeling tool, Enterprise Architect, has just released a new version, *with* Python code support. You can download EA at http://www.sparxsystems.com.au. It...
68
by: Lad | last post by:
Is anyone capable of providing Python advantages over PHP if there are any? Cheers, L.
40
by: Dave Hansen | last post by:
Please note crosspost. Often when writing code requiring function pointers, it is necessary to write functions that ignore their formal parameters. For example, a state machine function might...
2
by: Tim Chase | last post by:
A couple of hopefully short (interrelated) questions: 1) is there a way to suppress the banner when starting Python interactively? Something like a "--quiet" that would just drop you straight...
5
by: Don Li | last post by:
Hi, A web app server package that I'm using includes a bunch of open source UI components (heavy with javascripts). Inevitably it has bugs, e.g. "undefined" is null or not an object. This...
0
by: Paul Moore | last post by:
How can I suppress a Python warning globally (i.e., for all instances of Python I run)? I have a test suite that runs Python via sys.executable, so the -W flag won't work. A wrapper script doesn't...
0
by: Jean-Paul Calderone | last post by:
On Thu, 2 Oct 2008 23:39:29 +0100, Paul Moore <p.f.moore@gmail.comwrote: Site-wide configuration is what site customization modules are for. Check out sitecustomize.py in...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.