Those <IPython.core.display.HTML object> outputs

554 views
Skip to first unread message

clarkbr...@gmail.com

unread,
Jan 18, 2023, 6:49:14 PM1/18/23
to pyNastran Discuss
Steve,
Whenever I call write_bdf, the console catches
<IPython.core.display.HTML object>
read_op2 and read_bdf also emits those.
I'd like them to not do that.
I'm using Anaconda Spyder 5.2.2, Its About says also with Python 3.7.3 64-bit | Qt 5.9.7 | PyQt5 5.9.2 | Windows 10).
Thanks,
Clark

clarkbr...@gmail.com

unread,
Jan 19, 2023, 3:21:49 PM1/19/23
to pyNastran Discuss
Steve,
I seem to be using V 1.3.4 of pyNastran:
pip show pyNastran
Name: pyNastran
Version: 1.3.4

Clark

Steven Doyle

unread,
Jan 20, 2023, 1:05:22 AM1/20/23
to pynastra...@googlegroups.com
Are you running in ipython or jupyter notebook?  I don't see that in my testing at all.  Can you run
>>> pip list
>>> conda list
I'm not sure on Anaconda's command anymore for that, but it should be something like that. 

--
You received this message because you are subscribed to the Google Groups "pyNastran Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pynastran-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pynastran-discuss/767faf3b-4273-4d60-b12b-cd670c00bf23n%40googlegroups.com.

clarkbr...@gmail.com

unread,
Jan 20, 2023, 7:03:33 PM1/20/23
to pyNastran Discuss
Steve,
Using Anaconda Spyder, I'd say I'm using ipython, not a jupyter notebook.
I attached two files with the output of the requested commands, run in a Anaconda Prompt command shell as admin (which is how I install/update this stuff).
Clark
conda_list.txt
pip_list.txt

clarkbr...@gmail.com

unread,
Aug 6, 2023, 4:36:06 PM8/6/23
to pyNastran Discuss
Steve,
Every now and then, this bugs me so I go chasing it. I have figured out that bdf.read_bdf and read_op2 are producing them. It turns out these are text-based complaints about what it reads.  I figured this out by running my top python script simply in an Anaconda command shell. The text complaints are plainly visible.  This stuff is very much the stuff that gets printed when pyNastranGUI 1.3.4 reads the .dat and puts in the pyNastranGUI application log sub window and when it reads the .op2 and puts in the original .exe launch cmd window. I found that read_op2 has a log arg and it seems willing to dump all that stuff in the log and not in the Spyder console window. read_bdf doesn't have such a log arg and so dumps the <IPython.core.display.HTML object> lines into the console window. Is there a way to get these functions to not tell me all that stuff? Or put it somewhere where my users don't see it, like the log file?
Thanks,
Clark

Steven Doyle

unread,
Aug 6, 2023, 5:01:34 PM8/6/23
to pynastra...@googlegroups.com
Clark,

I'm not sure on all that Anaconda stuff, but the read_bdf and read_op2 functions have a log parameter.  If you're using the class-based approach, the log is in the init for the class and the read_bdf/read_op2 methods (a method is a function in a class), do not have the log argument.

There are two basic ways to do logging
  - The debug argument can be True/False/None (True=debug, False=info, None=warning)
  - The log argument takes priority

The log argument can be:
 - None in which case, it creates a print/SimpleLogger
 - user defined SimpleLogger/FileLogger (from cpylog)
 - user defined stock Python logger
The cpylog FileLogger writes a file :) and optionally writes the logging to the screen.

Steve

clarkbr...@gmail.com

unread,
Aug 6, 2023, 6:40:04 PM8/6/23
to pyNastran Discuss
Steve, Thanks for the prompt response.
With your explanation, I can get the log parameters to be taken in both and that makes all the HTML objects not show up on the console.
Thanks,
Clark
Reply all
Reply to author
Forward
0 new messages