Skip to content

Commit efe214c

Browse files
add a bit more info to README.md
1 parent 7bcf1f9 commit efe214c

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,25 @@ print("Hello world")
2828
```
2929
````
3030

31+
### Gotcha(s)
32+
33+
There are few things that you can't *really* do in this python interpreter. One thing is that printing is really weird. Printing is done to a local variable called `printed`, if you want to acess the output you'll have to do a top-level print. This is a side-effect of RestrictedPython.
34+
35+
For example:
36+
```py
37+
def print_num(num):
38+
print(num)
39+
return printed
40+
41+
print(print_num(num))
42+
```
43+
44+
a bit awkward, I know, but there's not much I can do about it.
45+
46+
## Libraries
47+
48+
It's on my mind, but I don't think it'll be possible without a much heaver layer of virtualization. Let me know if you have any ideas.
49+
3150
## My Attempts to Not Get Hacked
3251

33-
So, I'm not naive, I know how dangerous this stuff is, so I haven't just plugged user input into an `eval` or something. I'm using the library `RestrictedPython` to provide a (hopefully) safe execution environment and set up a 10 second timeout to avoid hangups on infinite loops. I'm really hoping I didn't miss anything, but please email me if I did.
52+
So, I'm not naive, I know how dangerous this stuff is, so I haven't just plugged user input into an `eval` or something. I'm using the library `RestrictedPython` to provide a (hopefully) safe execution environment and set up a 10 second timeout to avoid hangups on infinite loops. I'm really hoping I didn't miss anything, but please open and issue if I did.

0 commit comments

Comments
 (0)