Questions tagged [external-calls]

Questions on calling external executables, not necessarily through MathLink.

Filter by
Sorted by
Tagged with
0
votes
0answers
34 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 ...
2
votes
1answer
61 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 ...
4
votes
2answers
339 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 ...
1
vote
0answers
19 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, ...
0
votes
0answers
43 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: ...
2
votes
0answers
61 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 <...
2
votes
1answer
100 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 ...
2
votes
0answers
72 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 ...
1
vote
0answers
45 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 ...
3
votes
0answers
30 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 ...
1
vote
1answer
69 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 ...
1
vote
2answers
88 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) ...
5
votes
1answer
175 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, ...
1
vote
0answers
53 views

Alternative for ExternalEvaluate in version <11.2

I have code which uses ExternalEvaluate. Specifically the format using "Command" and ...
4
votes
2answers
265 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]...
0
votes
1answer
53 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 ...
0
votes
1answer
77 views

Evaluation taking extremely long

I am trying to solve the following: ...
0
votes
0answers
27 views

External Evaluate Conversion method

One can run a command for example in python using ExternalEvaluate ...
1
vote
0answers
41 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 ...
18
votes
3answers
1k 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 ...
0
votes
0answers
50 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 ...
2
votes
0answers
43 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 ...
3
votes
0answers
66 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. ...
0
votes
0answers
27 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, ...
0
votes
1answer
62 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, ...
0
votes
1answer
104 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 ...
1
vote
0answers
41 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): ...
5
votes
1answer
136 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 ...
3
votes
0answers
33 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?
1
vote
1answer
90 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 ...
0
votes
1answer
75 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: ...
1
vote
1answer
53 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 ...
1
vote
0answers
37 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....
0
votes
0answers
53 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?
0
votes
1answer
73 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}...
1
vote
0answers
60 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: ...
1
vote
1answer
50 views

External evaluations — selecting one of several Python versions

I have several Python versions installed and registered to Mathematica: FindExternalEvaluators["Python"] When I run the following code which one of ...
3
votes
1answer
80 views

IMO WSTP does not work with the Visual Studio 2019 tools, can you prove otherwise?

Can LINK addtwo.obj addtwotm.obj wstp64i4.lib /OUT:addtwo.exe actually work with Visual Studio 2019 tools, if so how? ...
0
votes
1answer
90 views

Capture screenshot of a certain window given its title

Is there a way to find the handle of a certain window and take a screenshot in Mathematica without having to call external programs? Something that connects with the API for the operating system.
5
votes
2answers
539 views

How to assemble Python abstract syntax trees (AST) in Mathematica?

I would like to assemble Python 'ast.Module' objects inside of Mathematica and then submit them to Python via e.g. ExternalEvaluate["exec(astObject)"]. ...
15
votes
4answers
436 views

Is it possible to call back to Mathematica when using Python through ExternalEvaluate?

ExternalEvaluate makes it possible to call Python code from Mathematica. The Wolfram Client for Python makes it possible to call Mathematica from Python. When using ...
2
votes
1answer
196 views

How to use Python's input() with External Evaluation?

I want to use input() in Python code which runs in the Wolfram Notebook. So I create an external evaluation cell by typing ">" and choosing Python. Then I define this function: ...
2
votes
0answers
18 views

Remove existing ServiceConnect authentication credentials

I am working on a project using the BingSearch ServiceConnect (ServiceConnect["BingSearch"]) and I would like to use a different authentication key then ...
2
votes
0answers
126 views

How to use Mathematica code in LaTeX files?

How can you use Mathematica code in LaTeX files? any similar to A random number is RNUMBER and the square of RNUMBER is RNUMBER^2 appearing numbers instead the capital letters (or Mathematica code) ...
4
votes
0answers
35 views

How to install node modules for external evaluation?

I was hoping for some extra clarity configuring additional modules for use in external evaluation, since there's no mention of this in the the nodejs workflow. It seems mathematica looks only at <...
3
votes
1answer
164 views

Missing Dependencies for Python in Conda in MMA 12.1 in Windows 10

I tried to run python code in MMA 12.1 on my Windows 10 computer. However, it seems that the python in conda has MissingDependencies, as shown below. According to this FAQ thread, https://support....
3
votes
0answers
46 views

How to use ExternalEvaluate in ResourceFunction?

Are there any working examples or best practices for writing ResourceFunction that package or depend on external language code (and package dependencies) through <...