Questions tagged [external-calls]

Questions on calling external executables, not necessarily through MathLink.

224 questions
12
votes
1 answer

How to extend External Language Input?

Is it possible to add a new option here and bind an evaluator? Is it possible to take SageMath, Matlab, Maple, etc. as examples to provide a complete process demonstration?
Aster
  • 3,836
  • 1
  • 18
  • 44
11
votes
1 answer

Interfacing Mathematica with Tableau desktop

Are there any known methods or examples of connecting Mathematica with Tableau in any fashion? I'll accept any solution that demonstrates a method of either: Calling Tableau from within Mathematica Or programmatically generating Tableau…
M.R.
  • 31,425
  • 8
  • 90
  • 281
10
votes
1 answer

How to run a shell script from inside Mathematica

I have a very basic question. I have a shell file test.sh that prints let's say Yeah to a file called output.txt: #!/bin/sh echo "Yeah" > output.txt I am running the Run command from the notebook: Run["sh test.sh"] But it is not creating the file…
Sayak
  • 121
  • 1
  • 4
7
votes
3 answers

How to close external app from Mathematica?

Is there any analogue to SystemOpen for closing applications from Mathematica? Documentation says: SystemOpen["file"] is essentially equivalent to double-clicking the file icon in your operating system. I would like to be able to check if some…
Vladimir
  • 1,503
  • 1
  • 12
  • 28
7
votes
1 answer

How to get output from standard error in command line?

I'm trying to run some external command line program in Mathematica, and I have problem getting the output. For example, Import["!echo hello world\nexit\n", "Text"] (*"hello world"*) run echo and get the output. However this doesn't work for…
xslittlegrass
  • 27,549
  • 9
  • 97
  • 186
7
votes
1 answer

Basic functionality of RunThrough

The documentation for RunThrough["command",expr] says that it executes an external command and returns the result. Does that mean it executes it as if on the command line? Why does this not return the string "blah" (or maybe…
CarbonFlambe
  • 1,234
  • 8
  • 13
5
votes
1 answer

How can I run .exe file in Mathematica

we have a .exe file. It takes input as .txt file and gives output as another .txt file. Now, I want to run that .exe file from MM. I tried in 2 way, Case 1 : using SystemOpen[]. It showing the following Window, Once I run the SystemOpen[path]. I…
subbu
  • 2,304
  • 1
  • 13
  • 32
5
votes
1 answer

NodeJS external session not returning value

I have setup my NodeJS session and performed the following test. I evaluate the following commands in ExternalLanguage cells. test = 1+1 returns 2 test returns 2 But when I try to get the value of the following builtin variable global Instead of…
user13892
  • 9,375
  • 1
  • 13
  • 41
4
votes
1 answer

Setting bash environment within external call

I would like to run external command from Mathematica. For this I need to have bash environment configured via reading the content of ${HOME}/.bashrc file. When I execute the following code in Mathematica notebook ReadList["!echo $PATH",…
mmal
  • 3,508
  • 2
  • 18
  • 38
4
votes
1 answer

Executing A Python Jupyter Book .ipynb or . py File From Mathematica 13

I'm trying to execute a .ipynb from Mathematica. I tried this code (*Import the Jupyter notebook file*)nb = Import["/Users/y/x.ipynb", "NB"]; (*Execute the notebook*) NotebookEvaluate[nb] But it doesn't work. Anyone know how to run a Python Jupyter…
4
votes
1 answer

How to assign the value to the mma variable when use the ExternalSession?

Of course, I can use the this code: session = StartExternalSession["Python"]; mmaVar1 = ExternalEvaluate[session, "a=[3,6,4];a"] {3, 6, 4} Then I can get a MMA variable mmaVar1, its name is assigned by Python. But I have to say it hard to write…
yode
  • 26,686
  • 4
  • 62
  • 167
4
votes
1 answer

How to open terminal from Mathematica

I am currently trying to open a terminal in Linux from Mathematica in which the present working directory is given by the Directory[]. My naive attempt RunProcess[{"gnome-terminal", "--working-directory=" <> Directory[]}] does not seem to work and…
Sungmin
  • 2,285
  • 15
  • 23
4
votes
1 answer

Run external program

I need to run an external program to process some files. I have added the location of the program to my .bash_profile (I use a mac) and I have verified that executing the program in Terminal works. However, whenever I execute Run["program"]…
amrods
  • 637
  • 3
  • 13
3
votes
0 answers

Is it possible to change the timeout for ExternalEvaluate?

I am using ExternalEvaluate in Mathematica 12.3.1.0 to do a computation with Jupyter and sagemath as kernel. Everything works fine if the computation finishes within 15 seconds, otherwise I get the error: while the python process still runs until…
2
votes
1 answer

Run external program and capture its output to stdout

There is RunThrough which captures the output and evaluates it. However, I would like the output as String. Is there a direct way without redirecting to temporary files etc.? Here is the code: pdftohtml = "pdftohtml.exe"; pdf = "test.pdf"; ans =…
Karsten W.
  • 1,383
  • 8
  • 21
1
2