summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.org>2015-08-31 15:40:26 +0200
committerTimotej Lazar <timotej.lazar@araneo.org>2015-08-31 15:40:26 +0200
commit9d4350983336a837c2fc65f377f3527d4714858e (patch)
tree663e6ef1b2bcb6a83f40d5a2d03ddc2717a3329d
parent7b98be750d401b2b6093d8de61e04c0e5f5fb764 (diff)
Update examples in readme.txt
-rw-r--r--readme.txt15
1 files changed, 12 insertions, 3 deletions
diff --git a/readme.txt b/readme.txt
index 33eb3a5..c901a5a 100644
--- a/readme.txt
+++ b/readme.txt
@@ -33,7 +33,16 @@ Run
Debugging
=========
+Some examples to run in a python interpreter:
+
>>> import server
->>> session = server.user_session.authenticate_and_create_session(user, pass)
->>> session.get_problem_data('prolog', 'family_relations', 'sister_2')
->>> ...
+>>> session = server.user_session.authenticate_and_create_session(<user>, <pass>)
+>>> session.get_problem_data('python', 'introduction', 'fahrenheit_to_celsius')
+
+>>> python = session.get_python()
+>>> python.test(231, 180, '''print('-17.7')''')
+>>> python.hint(231, 180, '''print('-17.7')''')
+
+>>> prolog = session.get_prolog()
+>>> prolog.test(231, 96, 'sister(X,Y):- parent(P,X), parent(P,Y), female(X).')
+>>> prolog.hint(231, 96, 'sister(X,Y):- parent(P,X), parent(P,Y), female(X).')