Code Monkey home page Code Monkey logo

Comments (5)

valq7711 avatar valq7711 commented on July 4, 2024

What does your compilation command look like?

from rapydscript.

valq7711 avatar valq7711 commented on July 4, 2024

from the doc:

RapydScript first tries to search the current directory of the file for the import. If that fails, it tries to search user-defined imports (which can be set via RAPYDSCRIPT_PATH environment variable as colon-separated directories, or semi-colon separated on Windows), and finally in the RapydScript builtin directory. This search order allows the user to easily override inbuilt functions.

You have two ways:

  • define RAPYDSCRIPT_PATH
  • create a simple one-line file with import file1.main in the parent folder of your packages and pass it to the compiler

from rapydscript.

dewball345 avatar dewball345 commented on July 4, 2024

ok, i'm kind of confused on the RAPYDSCRIPT_PATH one; Are you supposed to change the environment variable whenever you create a new package, or are editing in a new project? That would be a nightmare! Also, I tried the second method but it didn't work

from rapydscript.

dewball345 avatar dewball345 commented on July 4, 2024

ok, i solved it by configuring the --import-path attribute, though I don't understand the RAPYDSCRIPT_PATH variable

from rapydscript.

Aareon avatar Aareon commented on July 4, 2024

For example, if you wanted to import from a directory using --import-path, you would do something like:
rapydscript main.py --import-path "./lib"

Using environment variables is a little different.
export RAPYDSCRIPT_PATH="./lib"; rapydscript main.py
If you wanted to save this environment variable permanently, add it to your .profile. Your profile will depend on your OS.

from rapydscript.

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.