Help Please ! Undocumented ERROR message so dont know how to fix the problem

Steve D'Aprano steve+python at pearwood.info
Tue May 2 08:06:30 EDT 2017


On Tue, 2 May 2017 12:57 pm, murdock wrote:

> I am having a problem that seems to persist. I have written a program that
> makes a mathematical calculation and uses a uses library that I have
> written. It had been working but somehow in playing around with it, it
> stopped....go figure!  But here is the thing, when I run the program it
> gives me a very ambiguous message with only a string as in:
> 
> "The Receiver Noise Figure =  <function _Noise_Figure at
> 0x00000000063E5A60>  dBm"

That is absolutely not a Python error message.

There are two sorts of Python error messages: tracebacks, and segmentation
faults. You should never see  segmentation fault (if you do, it is a bug or
corruption in the Python interpreter) but if you do, there may not even be
message aside from "Segmentation fault". So forget all about them.

The only sort of Python error message you are likely to see is a traceback,
which looks like this:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: not enough values to unpack (expected 2, got 1)


There may be more lines between the "Traceback" line and the last line,
which will be the actual error. It may not be ValueError, it could be
TypeError, AttributeError, IndexError, or many other things.

> now the program is being run under PyScripter

What happens if you *don't* run the program under PyScripter?

It looks to me that PyScripter is trying to be "helpful" by hiding the
actual error message from you, and perhaps showing you some random
diagnostic, or the line of code that failed.

Of course that's not helpful at all. See if you can run the script without
involving PyScripter. The easiest way is to enter the following at a
terminal or console:

python myscript.py

Replace the "myscript.py" with the actual name of your Python .py file.



> I am told that the error message is NOT an PyScripter error but in fact a
> Python message. 

Who told you this? I'm pretty sure they're wrong.

Unless they are going by more information than you've told us.


-- 
Steve
Emoji: a small, fuzzy, indistinct picture used to replace a clear and
perfectly comprehensible word.




More information about the Python-list mailing list