You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,8 @@ The following should be installed on your machine and be added to the path.
27
27
|Python | python |
28
28
|JavaScript(in node.js environment) | node.js |
29
29
30
+
The library stores the source files for programs in the home directory in a folder named `.compile-run2`. Make sure you have permissions for this folder.
//I have 2 versions of python installed 2.7 and 3.6. I can use 3.6 using python3
124
+
//to run python3 using compile-run I can do something like
125
+
python.runFile('/home/projects/scripts/abc.py',{
126
+
executionPath:'python3'
127
+
},(err,result)=>console.log(err ? err : result));
128
+
```
129
+
130
+
```javascript
131
+
//If I want to provide custom path of gcc in cpp
132
+
cpp.runFile('E:\\abc.cpp',{
133
+
compilationPath:'<path to gcc>'// something like C:\\Program Files\\gcc\\bin
134
+
},(err,result)=>console.log(err ? err : result));
135
+
```
136
+
109
137
## Result
110
138
111
139
Result is an object with the following keys:-
@@ -125,6 +153,8 @@ API's offer an optional options object which has following keys:-
125
153
1.`stdin`\<string> - Input/stdin you want to pass to the program.
126
154
2.`timeout`\<number> - timeout for program execution in milliseconds. Default is 3000 milliseconds.
127
155
3.`compileTimeout` - timeout during compilation for c, cpp, java in milliseconds. Default is 3000 milliseconds. Would be ignored if passed for node or python
156
+
4.`compilationPath` - path for the compiler for c, cpp and java i.e for gcc and javac respectively. These paths defined by you if provided else defaults would be used.
157
+
5.`executionPath` - path for the command to execute the program used in java, python, nodejs i.e for `java`, `python` and `node` respectively. These paths defined by you if provided else defaults would be used.
0 commit comments