-
Notifications
You must be signed in to change notification settings - Fork 78
Coding languages
Repeat supports several coding languages to create tasks. Tasks written in different languages can easily interact with each other using shared variables.
Once a task is selected, the main programming language is automatically switched to that task's language.
To manually switch between programming languages, choose Tools --> Compiling languages... in the top right drop down menu.
Manual is a simple UI driven way to construct a task. Its features are meant to be non comprehensive and limited compared to other programming languages available below. This is most suitable for small tasks that don't require complex logic and special function calls.
Repeat is written in Java, so Java is an easy language to support. There is no external dependencies required to support writing new tasks in this language.
In Java, it is often convenient that there is an external library that the task wants to call. In order to be able to include external libraries in form of JARs when compiling Java tasks, choose Settings --> Configure compilers... in the top right drop down menu. Note that this only applicable if the current coding language is Java.
Since Python 2 has been deprecated, Repeat only supports Python 3.
To enable support for Python, follow these steps:
- Switch compiling language to Python
- Select Settings --> Set compiler path... from the top right drop down menu. This will allow you to specify the Python executable to launch Python. This is basically the executable used to launch your Python program (e.g.
$executable main.py
). On Linux, this can be found usingwhich python3
, which usually returns /usr/bin/python3. - Select Tools --> Native modules... from the top right drop down menu. This will redirect you to a separate page to manage IPC modules.
- Choose Python IPC Client row from the table, then click on the "play" button to start the Python native module.
- You can now go back to the main page and start writing code.
In Python, it is much easier to import an external library as dependency. You can use one of the following ways to import an arbitrary file into the Python program:
- my_module = importlib.import_module('os.path') (See this Stackoverflow answer)
- sys.path.insert(0, 'path_to_lib_dir') (See this Stackoverflow answer)
Repeat compiles C# code using the same .NET version as the one you have on the system to launch the native C# module with.
To enable support for C#, follow these steps:
- Select Tools --> Native modules... from the top right drop down menu. This will redirect you to a separate page to manage IPC modules.
- Choose C# IPC Client row from the table, then click on the "play" button to start the C# native module.
- You can now go back to the main page and start writing code.