fieker-DuValspielwiese
Last change
on this file since ef52d6 was
894057,
checked in by Oleksandr Motsak <motsak@…>, 13 years ago
|
ADD: Tests from online manual (res+stat on mamawutz): short ones Tst/Manual/s.lst
|
-
Property mode set to
100644
|
File size:
768 bytes
|
Line | |
---|
1 | LIB "tst.lib"; tst_init(); |
---|
2 | pyobject pystr = "Hello"; |
---|
3 | pyobject pyint = 2; |
---|
4 | string singstr = string(pystr + " World!"); |
---|
5 | singstr; |
---|
6 | pystr + pyint; // Error: not possible |
---|
7 | pystr * pyint; // But this is allowed, |
---|
8 | pystr * 3; // as well as this; |
---|
9 | |
---|
10 | python_run("def newfunc(*args): return list(args)"); // syncs contexts! |
---|
11 | newfunc(1, 2, 3); // newfunc also knowd to SINGULAR |
---|
12 | |
---|
13 | def pylst = python_eval("[3, 7, 1]"); |
---|
14 | proc(attrib(pylst, "sort"))(); // Access python member routines as attributes |
---|
15 | pylst.sort(); // <- equivalent short-notation |
---|
16 | pylst."sort"(); // <- alternative short-notation |
---|
17 | pylst; |
---|
18 | |
---|
19 | python_import("os"); // Gets stuff from python module 'os' |
---|
20 | name; // The identifier of the operating system |
---|
21 | tst_status(1);$ |
---|
Note: See
TracBrowser
for help on using the repository browser.