yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #13078
Re: [Question #295951]: yade on kubuntu 16.04
Question #295951 on Yade changed:
https://answers.launchpad.net/yade/+question/295951
Status: Needs information => Answered
James X proposed the following answer:
OK, so my prior message was just an example of me not understanding what
yade was supposed to do (I wasn't aware that you could/should run
commands in yade if you were running from a script file). I just assumed
that script files were designed to be run and then exited/cancelled out
of when they finished running.
for example, if I run "hourglass.py", I get the same error as originally
described. Strangely enough, there seem to be seem terminal commands
that work just fine. For example, when I type in "O.run()" and
"O.bodies[0]", the simulation runs or I am told what O.bodies[0] is.
Below is the print out of what happens when I run yadedaily
"hourglass.py", then first attempt to add "10+5", then attempt to run
the simulation by typing "O.run()", then pausing it by typing
"O.pause()", then multiplying "10 * int(5.5)", then finding what is
returned when I type in "O.bodies[1]", and finally crashing the program
by running "len(O.bodies)". I would try using the inspector, but I'm
still very new to Yade and quite honestly have no idea what to do with
it.
~/trunk-master/examples/hourglass$ yadedaily hourglass.py
Welcome to Yade 2016.06a-2-86aa164~xenial
TCP python prompt on localhost:9000, auth cookie `eukysd'
XMLRPC info provider on http://localhost:21000
Running script hourglass.py
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view (use h-key for showing help), F10 both, F9 generator, F8 plot. ]]
[0;34mYade [[1;34m1[0;34m]: [0m10+5
[0;34mYade [[1;34m1[0;34m]: [0m -> [1]: 15
O 2[0;34m]: [0mO.run()
[0;34mYade [[1;34m2[0;34m]: [0mO.pause()
[0;34mYade [[1;34m4[0;34m]: [0m10*int(5.5)
[0;34mYade [[1;34m4[0;34m]: [0m -> [4]: 50
[0;34mYade [[1;34m5[0;34m]: [0mO.bodies[1]
[0;34mYade [[1;34m5[0;34m]: [0m -> [5]: <Body instance at 0x3084be0>
[0;34mYade [[1;34m6[0;34m]: [0mlen(O.bodies)
[0;34mYade [[1;34m6[0;34m]: [0m -> [6]: 3500
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/usr/bin/yadedaily in <module>()
289 import yade.qt
290 qapp=QApplication(sys.argv)
--> 291 userSession(gui=gui,qapp=qapp)
292
293 if __name__ == "__main__":
/usr/bin/yadedaily in userSession(gui, qapp)
240 InteractiveShellEmbed.banner1=banner+'\n'
241 ipshell=InteractiveShellEmbed()
--> 242 ipshell()
243
244 ## run userSession in a way corresponding to the features we use:
/usr/lib/python2.7/dist-packages/IPython/terminal/embed.pyc in __call__(self, header, local_ns, module, dummy, stack_depth, global_ns, compile_flags)
151 # our call and get the original caller's namespaces.
152 self.mainloop(local_ns, module, stack_depth=stack_depth,
--> 153 global_ns=global_ns, compile_flags=compile_flags)
154
155 self.banner2 = self.old_banner2
/usr/lib/python2.7/dist-packages/IPython/terminal/embed.pyc in mainloop(self, local_ns, module, stack_depth, display_banner, global_ns, compile_flags)
243
244 with self.builtin_trap, self.display_trap:
--> 245 self.interact(display_banner=display_banner)
246
247 # now, purge out the local namespace of IPython's hidden variables.
/usr/lib/python2.7/dist-packages/IPython/terminal/interactiveshell.pyc in interact(self, display_banner)
567 self.run_cell(source_raw, store_history=True)
568 hlen_b4_cell = \
--> 569 self._replace_rlhist_multiline(source_raw, hlen_b4_cell)
570
571 # Turn off the exit flag, so the mainloop can be restarted if desired
/usr/lib/python2.7/dist-packages/IPython/terminal/interactiveshell.pyc in _replace_rlhist_multiline(self, source_raw, hlen_before_cell)
472
473 for i in range(hlen - hlen_before_cell):
--> 474 self.readline.remove_history_item(hlen - i - 1)
475 stdin_encoding = get_stream_enc(sys.stdin, 'utf-8')
476 self.readline.add_history(py3compat.unicode_to_str(source_raw.rstrip(),
ValueError: No history item at position 2600
--
You received this question notification because your team yade-users is
an answer contact for Yade.