<div dir="ltr">testing toXML in python.   BackgroundCollection.py works.<div><br></div><div>These don't:</div><div>$ python HelloWorld.py<br>x3d.py package loaded, have fun with X3D Graphics!<br>Traceback (most recent call last):<br>  File "HelloWorld.py", line 77, in <module><br>    print (     newModel.toXML())<br>  File "C:\x3d-code\<a href="http://www.web3d.org" target="_blank">www.web3d.org</a>\x3d\stylesheets\python\examples\x3d.py", line 6878, in toXML<br>    result += str(self.Scene.toXML(indentLevel=indentLevel+1))<br>  File "C:\x3d-code\<a href="http://www.web3d.org" target="_blank">www.web3d.org</a>\x3d\stylesheets\python\examples\x3d.py", line 6679, in toXML<br>    result += each.toXML(indentLevel=indentLevel+1)<br>  File "C:\x3d-code\<a href="http://www.web3d.org" target="_blank">www.web3d.org</a>\x3d\stylesheets\python\examples\x3d.py", line 19183, in toXML<br>    result += each.toXML(indentLevel=indentLevel+1)<br>  File "C:\x3d-code\<a href="http://www.web3d.org" target="_blank">www.web3d.org</a>\x3d\stylesheets\python\examples\x3d.py", line 40543, in toXML<br>    result += each.toXML(indentLevel=indentLevel+1)<br>  File "C:\x3d-code\<a href="http://www.web3d.org" target="_blank">www.web3d.org</a>\x3d\stylesheets\python\examples\x3d.py", line 35796, in toXML<br>    for each in self.appearance:<br>TypeError: 'Appearance' object is not iterable<br><br>coderextreme@DESKTOP-DOPK2VD MINGW64 /c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/python/examples" target="_blank">www.web3d.org/x3d/stylesheets/python/examples</a><br>$ python HelloWorldPrefixed.py<br>x3d.py package loaded, have fun with X3D Graphics!<br>Traceback (most recent call last):<br>  File "HelloWorldPrefixed.py", line 77, in <module><br>    print (     newModel.toXML())<br>  File "C:\x3d-code\<a href="http://www.web3d.org" target="_blank">www.web3d.org</a>\x3d\stylesheets\python\examples\x3d.py", line 6878, in toXML<br>    result += str(self.Scene.toXML(indentLevel=indentLevel+1))<br>  File "C:\x3d-code\<a href="http://www.web3d.org" target="_blank">www.web3d.org</a>\x3d\stylesheets\python\examples\x3d.py", line 6679, in toXML<br>    result += each.toXML(indentLevel=indentLevel+1)<br>  File "C:\x3d-code\<a href="http://www.web3d.org" target="_blank">www.web3d.org</a>\x3d\stylesheets\python\examples\x3d.py", line 19183, in toXML<br>    result += each.toXML(indentLevel=indentLevel+1)<br>  File "C:\x3d-code\<a href="http://www.web3d.org" target="_blank">www.web3d.org</a>\x3d\stylesheets\python\examples\x3d.py", line 40543, in toXML<br>    result += each.toXML(indentLevel=indentLevel+1)<br>  File "C:\x3d-code\<a href="http://www.web3d.org" target="_blank">www.web3d.org</a>\x3d\stylesheets\python\examples\x3d.py", line 35796, in toXML<br>    for each in self.appearance:<br>TypeError: 'Appearance' object is not iterable<br></div><div><br></div><div>-----------------------</div><div><br></div><div>Appearance is an SFNode, so it's not a iterable.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 20, 2020 at 10:27 AM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">You have both a x3d.py and x3d folder.  I don't think that's allowed, or you need to put more symbols in __init__.py, perhaps?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 20, 2020 at 10:23 AM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">On the x3d.py page @ web3d:<div><br></div><div><i style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">Workaround</i><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">: if needed for development, simply download </span><a href="https://www.web3d.org/x3d/stylesheets/python/x3d.py" style="font-family:"Times New Roman";font-size:medium" target="_blank">x3d.py</a><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"> package source and place it in same directory as your python program.</span> </div><div><br></div><div>That works too! <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 20, 2020 at 10:21 AM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Okay!<div>from x3d import *</div><div>does not work</div><div><br></div><div>import x3d</div><div>works.</div><div><br></div><div>puzzling.</div><div><br></div><div>John</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 20, 2020 at 10:14 AM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I give up. I can't get a simple import to work!  I have python 3.8.2 (latest).<div><br></div><div>Hmm.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 20, 2020 at 9:32 AM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">coderextreme@DESKTOP-DOPK2VD MINGW64 /c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/python/examples" target="_blank">www.web3d.org/x3d/stylesheets/python/examples</a><br>$ ls<br>BackgroundCollection.py   HelloWorld.py   HelloWorldPrefixed.py   README.md<br>BackgroundCollection.x3d  HelloWorld.x3d  PythonX3dSmokeTests.py<br><br>coderextreme@DESKTOP-DOPK2VD MINGW64 /c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/python/examples" target="_blank">www.web3d.org/x3d/stylesheets/python/examples</a><br>$ python HelloWorld.py<br>Traceback (most recent call last):<br>  File "HelloWorld.py", line 21, in <module><br>    from x3d import *<br>AttributeError: module 'x3d' has no attribute 'SFBool'<br><br>coderextreme@DESKTOP-DOPK2VD MINGW64 /c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/python/examples" target="_blank">www.web3d.org/x3d/stylesheets/python/examples</a><br>$ python BackgroundCollection.py<br>Traceback (most recent call last):<br>  File "BackgroundCollection.py", line 21, in <module><br>    from x3d import *<br>AttributeError: module 'x3d' has no attribute 'SFBool'<br><br>coderextreme@DESKTOP-DOPK2VD MINGW64 /c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/python/examples" target="_blank">www.web3d.org/x3d/stylesheets/python/examples</a><br>$ python HelloWorldPrefixed.py<br>Traceback (most recent call last):<br>  File "HelloWorldPrefixed.py", line 26, in <module><br>    newModel=x3d.X3D(profile='Immersive',version='3.3',<br>AttributeError: module 'x3d' has no attribute 'X3D'<br><br>coderextreme@DESKTOP-DOPK2VD MINGW64 /c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/python/examples" target="_blank">www.web3d.org/x3d/stylesheets/python/examples</a><br>$ python PythonX3dSmokeTests.py<br>===================<br>Importing local development copy of X3D package:<br>  from x3d import *<br>Traceback (most recent call last):<br>  File "PythonX3dSmokeTests.py", line 23, in <module><br>    from x3d import *<br>AttributeError: module 'x3d' has no attribute 'SFBool'<br><div><br></div><div>Umm.  It's a race to see who gets toXML first!</div><div><br></div><div>John</div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>