Questions tagged [external-calls]

Questions on calling external executables, not necessarily through MathLink.

Filter by
Sorted by
Tagged with
4 votes
1 answer
60 views

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} ...
user avatar
  • 23.7k
3 votes
1 answer
103 views

Use function defined in Mathematica from Matlab

This question is the same as this post which was closed too early to be answered and efforts to reopen it were unsuccessful. How could we use a defined function inside Mathematica from Matlab? With ...
user avatar
  • 5,444
3 votes
1 answer
55 views

RunProcess : Save directly to Mathematica Variable

I can convert mysource.jpg to myresult.jpg using an external program myprog.exe, and set a ...
user avatar
  • 2,825
2 votes
0 answers
173 views

Call function defined in Mathematica from Matlab [closed]

Is it possible to call a defined function inside Mathematica like InterpolationFunction[...] from Matlab? Thanks!
user avatar
1 vote
0 answers
57 views

Using a Remote Kernel

I'm trying to connect the front end on Mac OS (version 13.0) use a remote (also 13.0) kernel running on an Ubuntu machine. I've followed the basic steps here (https://reference.wolfram.com/language/...
user avatar
0 votes
0 answers
35 views

Error while using External Evaluator (Python)

In the above screenshot, I've shared the installed and registered version of python. However, when I try to use it, it ends up with an error. ...
user avatar
  • 449
4 votes
1 answer
91 views

Change DataStructure (or maybe just a symbol) from JLink/Java program

I try to use JLink and Java program for receiving responses from the abstract WebSocket server. WSS not supported by Wolfram Language now, but I can use this java project + JLink for the creating a ...
user avatar
1 vote
0 answers
33 views

Creating a function, saving it in a file, and calling it in another file

I'd like to know how to wrap up a function in a file an then how to call it in another file. For example, I've the following long piece of code which is used to create the function PlotExplorer. I ...
user avatar
7 votes
2 answers
260 views

Calling a Python class function from ExternalEvaluate

I am attempting to use ExternalEvaluate to use some python packages (ARC) to save me some effort in performing the calculations in Mathematica, and for the most part I think it works as intended. The ...
user avatar
  • 113
7 votes
1 answer
104 views

RunProcess computation time steadily increasing for the same command -- what gives?

I am running an externally compiled C++ program using RunProcess, and I encountered a strange thing: when I run the RunProcess ...
user avatar
  • 311
1 vote
1 answer
55 views

How can I temporarily pause Dynamic expressions while external programs are called?

I am displaying a progress bar in my notebook like this: ...
user avatar
0 votes
0 answers
55 views

Failure connecting local MySQL server

I have locally installed and run the latest version of Oracle MySQL Community Server 8.0 on port 3306. I successfully established connections to it from locally installed Oracle MySQL Workbench 8.0 ...
user avatar
5 votes
1 answer
76 views

Is it possible to run Linux utils from Mathematica using Windows Subsystem for Linux?

I have Windows 10 Professional x64 with WSL2 installed. I've also installed Ubuntu 20.04 LTS from Microsoft Store. I can type ubuntu2004 in the CMD and get access ...
user avatar
0 votes
0 answers
46 views

Is it possible to run kernel in address space of another process?

Kernel executables seem to be relatively small wrappers around "dynamic link library" that contains all the functionality of the kernel. Is it possible to load the kernel (as a dynamic link ...
user avatar
2 votes
1 answer
78 views

ExternalEvaluate not running the whole Python file

I have the following 'test.py' written in Python: import numpy as np f = open('normals.txt', 'r') content = f.read() print(content) and I want to execute it from ...
user avatar
4 votes
2 answers
353 views

How to transfer a list as a Python function argument

This issue was already discussed here, but the answer is unclear yet. I use very simple Python function for converting a string list to upper case ...
user avatar
4 votes
0 answers
80 views

Exporting a DimensionReducerFunction

I need to run my DimensionReducerFunction in a standalone fashion outside of MMA. That is, without calling into a kernel or through an APIFunction. For example, ...
user avatar
  • 30.4k
0 votes
0 answers
44 views

How to extract some information from my email?

I want to search my email inbox by word "subscriber" and then extract some information from results (precisely from the body of each email). So the following steps should be done: ...
user avatar
  • 1,047
2 votes
0 answers
77 views

How to login to Gmail using MailServerConnect[ ]?

I am trying to login to my Gmail account using the built-in function MailServerConnect[] and require help with the process: Connecting to the Gmail server (using <...
user avatar
  • 1,047
2 votes
1 answer
122 views

Python packages inside Mathematica's notebook: problem with sympy [closed]

With Mathematica's notebook, sometimes I hit the > key at the beginning of a new line and start writing python code. I can call and use the standard package ...
user avatar
  • 641
2 votes
0 answers
76 views

Store Mathematica results in an external rdbms

I want to store Mathematica results in an external rdbms, Postgres specifically. The Mathematica documentation talks a lot (eg in 'Relational Database Quick Start') about extracting data from external ...
user avatar
  • 21
1 vote
0 answers
48 views

Open a Terminal by StartProcess and write commands to it does not work as expected

Probably my expecations are wrong: I want to open a terminal window on my Xubuntu 20.04 system. Then I want to issue the command tail -f ~/M to display the tail of ...
user avatar
3 votes
0 answers
31 views

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 ...
user avatar
1 vote
1 answer
75 views

Running an executable in the shell from Mathematica

I have a txt file called exec.txt, that I have made executable using chmod. Running it from the shell using ./exec.txt works correctly. However, I need to run it from my Mathematica nb file. Following ...
user avatar
  • 181
1 vote
2 answers
109 views

Mathematica-Python interfacing: time lag in importing Python output in Mathematica

GOAL: I want to do a part of computation in Mathematica, write a text file (I call it INPUT.txt) containing the result from this partial calculation. Then I want to import this text file (INPUT.txt) ...
user avatar
  • 157
5 votes
1 answer
185 views

How to run wolfram code from the finder in macos?

I'd like to run wolfram code (probably a .wls script) on a file or set of files by selecting them in the finder and using Right-click > Services. For example, ...
user avatar
  • 30.4k
1 vote
0 answers
55 views

Alternative for ExternalEvaluate in version <11.2

I have code which uses ExternalEvaluate. Specifically the format using "Command" and ...
user avatar
  • 3,603
4 votes
2 answers
339 views

Within Mathematica, how to export the output of python code to the Mathematica expression?

I run some Python code in the external code cell as following: The above Python code produced the result (as shown with red [1]...
user avatar
  • 1,250
1 vote
1 answer
58 views

Quit Mathematica script (no matter what)

I have a complicated script (not just written by me) that gets called using MathKernel -script script.m. Among others script.m ...
user avatar
  • 3,603
0 votes
1 answer
85 views

Evaluation taking extremely long

I am trying to solve the following: ...
user avatar
  • 103
0 votes
0 answers
33 views

External Evaluate Conversion method

One can run a command for example in python using ExternalEvaluate ...
user avatar
  • 3,603
1 vote
0 answers
52 views

Run a command which has a file parameter when the file path passed contains non-ASCII characters

I want to do run a Linux command from a Mathematica notebook. I see, that Mathematica and my Linux operating system use different character coding. The problem is that the directories and the file ...
user avatar
18 votes
3 answers
2k views

How can I use Python's SciPy and NumPy functions in Mathematica to find the minimum of a function?

I have written my code in Mathematica, final aim of this code is to find the minimum of a function. I found that FindMinimum and ...
user avatar
0 votes
0 answers
57 views

Using Mathematica to run an external bash script

This seems like a straightforward problem, but I am having trouble. I have a bash script that runs a parallel process (OpenFoam). I would like to call this script from a Mathematica Module. Processes ...
user avatar
2 votes
0 answers
45 views

Exporting packages containing "Python Code" cells

I created a notebook with Python code cells (evaluated using External Evaluate) as can be created by typing > at the beginning of a cell. (And choosing Python ...
user avatar
  • 3,603
3 votes
0 answers
80 views

Create "Python Code" cells using custom executable

In https://mathematica.stackexchange.com/a/155815/45020 it is explained how to run cells using a custom virtual environment. How can I quickly create a cell that is evaluated using this environment. ...
user avatar
  • 3,603
0 votes
0 answers
35 views

ExternalEvaluate Error

I have installed NodeJS. session = StartExternalSession["NodeJS"]; And I ran the comci.js file. comci.js file URL ( enter link description here) However, ...
user avatar
  • 1,091
0 votes
1 answer
69 views

How to run JS files using NodeJS?

I have installed NodeJS. And I ran the comci.js file. comci.js file URL ( http://naver.me/5MUV22Uj ) After that, I entered the command getTimeTable according to the format and executed it. However, ...
user avatar
  • 1
0 votes
1 answer
114 views

How to call Python Methods from Mathematica employing ExternalEvaluate?

This question is about the compatibility of methods written in Python and ExternalEvaluate from Mathematica. ExternalEvaluate allows Python functions to be called from Mathematica. For example, the ...
user avatar
1 vote
0 answers
62 views

How to use conda environments in StartExternalSession?

I am trying to get a conda python environment to run in Mathematica under Windows. It includes the following packages (in case you want to reproduce): ...
user avatar
  • 967
5 votes
1 answer
176 views

Importing Mathematica defined function in python to do further computations. [Mathematica-Python interfacing]

Say I have a function FUN defined in Mathemtica notebook: ...
user avatar
  • 157
5 votes
1 answer
143 views

How to enable WakaTime for the Mathematica front end?

WakaTime is a tool for logging one's coding activities, and now have amazing coverage for code editors. Although I write Wolfram in VS Code, I still spend a lot of time tweaking and testing in the ...
user avatar
  • 658
3 votes
0 answers
35 views

Can one preset credentials for ServiceConnect["Twitter", "New"] to allow wolframscript headless use?

Trying to run some wolframscript code from a server, is it possible to set ServiceConnect credentials in the environmental variables for example?
user avatar
  • 365
1 vote
1 answer
137 views

ExternalEvaluate Python: Cannot import local file

I am trying to use ExternalEvaluate for a Python session. For some reason I cannot import a file from there that I can import successfully when I call python some ...
user avatar
  • 3,603
0 votes
1 answer
91 views

Send plain text out through a COM port (such as Labview, MATlab, Python or even a terminal emulator)

We have purchased a pump. And we would like to control the pump through Mathematica. The furnished has explained to us: ...
user avatar
  • 1,641
1 vote
1 answer
56 views

External Controllers - Unexpected Behaviour and Operation

My system has Windows 10 Pro 20H2, Mathematica 11.1.1.0 and the following external controllers plus Loupedeck Live: 1- Why do the following commands work: a) These don't: b) These don't update in ...
user avatar
  • 101
1 vote
0 answers
43 views

Substitute for MathLink to integrate PARI with Mathematica?

How does one access MathLink with current version of Mathematica? I'm trying to integrate the "computer algebra system" PARI with Mathematica, as documented at https://pari.math.u-bordeaux....
user avatar
  • 11.3k
0 votes
0 answers
63 views

How to call LabVIEW's .vi files in Mathematica?

I want to use Mathematica to process the data collected by LabVIEW, is there any way to implement Mathematica's call to LabVIEW's .vi files?
user avatar
0 votes
1 answer
83 views

Solving linear systems efficiently

In certain calculation I encountered a system of linear equations in 144 variables, and it takes hours to compute. Most probably the reason is that coefficients are really huge integers (about $10^{50}...
user avatar
1 vote
0 answers
67 views

Problem with RunProcess

I'm trying to use the RunProcess function to run docker on Mac OS using Mathematica. But there is a problem: ...
user avatar
  • 11

1
2 3 4 5