Code Monkey home page Code Monkey logo

Comments (6)

SemaiCZE avatar SemaiCZE commented on July 23, 2024

Hi,

let's start with simple python program:

#!/usr/bin/env python3

print("Hello world!")

Now, you initialize isolate with

$ isolate --cg --init

It will print path to working directory of sandbox. Now you copy that python file (assume it's a.py) into that path with additinal subdirectory box. For example, could be /var/local/lib/isolate/0/box. With this done, run that in isolate

$ isolate --cg --env=HOME=/home/user --run /usr/bin/python3 a.py

Python requires passing some enviroment variables. You can tweak that to fit your needs. It should print something like

Hello world!
OK (0.067 sec real, 0.081 sec wall)

Don't forget to cleanup the isolate sandbox

$ isolate --cg --cleanup

Please refer to original man page if you want up-to-date documentation, that url you provided may be a bit outdated.

from isolate.

hermanzdosilovic avatar hermanzdosilovic commented on July 23, 2024

Thanks for your quick response. It works as expected. Why does Python require $HOME environment variable?

from isolate.

hermanzdosilovic avatar hermanzdosilovic commented on July 23, 2024

For anybody out there reading this, I have created new issue regarding running Java programs and overhead in it: #14

from isolate.

stefano-maggiolo avatar stefano-maggiolo commented on July 23, 2024

Re python and the requirement of having HOME, we noticed the same in @cms-dev, see here - I suppose it is used to look for additional packages in ~/.local/lib/python... anyway, as you see in the link, we set it to the sandbox directory.

from isolate.

hermanzdosilovic avatar hermanzdosilovic commented on July 23, 2024

Thanks @stefano-maggiolo

from isolate.

andotorg avatar andotorg commented on July 23, 2024

🐂

from isolate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.