aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/py/scripts/script.py
diff options
context:
space:
mode:
Diffstat (limited to 'externals/grill/py/scripts/script.py')
-rw-r--r--externals/grill/py/scripts/script.py53
1 files changed, 53 insertions, 0 deletions
diff --git a/externals/grill/py/scripts/script.py b/externals/grill/py/scripts/script.py
new file mode 100644
index 00000000..4796949c
--- /dev/null
+++ b/externals/grill/py/scripts/script.py
@@ -0,0 +1,53 @@
+# py/pyext - python script objects for PD and MaxMSP
+#
+# Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+# For information on usage and redistribution, and for a DISCLAIMER OF ALL
+# WARRANTIES, see the file, "license.txt," in this distribution.
+#
+
+"""Several functions to show the py script functionality"""
+
+import sys
+
+print "Script initialized"
+
+try:
+ print "Script arguments: ",sys.argv
+except:
+ print
+
+def numargs(*args): # variable argument list
+ """Return the number of arguments"""
+ return len(args)
+
+def strlen(arg):
+ """Return the string length"""
+ return len(arg)
+
+
+def strcat(*args):
+ """Concatenate several symbols"""
+ s = ""
+ for si in args:
+ s += str(si)
+ return s
+
+
+def addall(*args): # variable argument list
+ s = 0
+ for si in args:
+ s += si
+ return s
+
+
+def ret1():
+ return 1,2,3,4
+
+
+def ret2():
+ return "sd","lk","ki"
+
+
+def ret3():
+ return ["sd","lk","ki"]
+