3 // Copyright (c) 2014 - Michele De Stefano (micdestefano@users.sourceforge.net)
5 // Distributed under the MIT License (See accompanying file LICENSE)
9 * \example tuple_usage.pycmd
11 * Shows the usage of the tuple_usage extension from the Python prompt.
14 mds_utils::python::Tuple usage example from the Python prompt:
17 >>> import tuple_usage as tu
18 >>> t = tu.create_tuple([11,22,'tt',('a',7,0.9)])
21 (11, 22, 'tt', ('a', 7, 0.9))
22 >>> t2 = tu.create_from_fusion()
25 >>> t4 = tu.create_from_seq(t2)
28 >>> t5 = tu.create_from_seq2(t4)
31 >>> tu.access_element(t,1)
33 >>> tu.access_element(t,-1)
35 >>> tu.access_element(t,-2)
37 >>> tu.set_element(t,2,0)
38 Traceback (most recent call last):
39 File "<stdin>", line 1, in <module>
40 RuntimeError: Cannot assign to element 2