We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

2 posts • Page 1 of 1
22over7
Posts: 72
Joined: Sat Jun 13, 2020 8:39 pm

mathematica format + commandline

Thu Jul 09, 2020 2:22 am

Greetings,
I'm new to both raspberry pi and to mathematica, and I'd be most appreciative for your help regarding basic setups of mathematica under pi.

(1) I would like to use bigger fonts and to set a darker background color. If I click Format --> Font and change the font size there, my next line of input gets bigger, but the output does not and this change does not persist. I also tried Format -> Size but that makes not difference at all. How should I make this change permanent for the rest of the worksheet?

As for background color, I tried Format -> Background Color
rasp-2.png
screenshot showing formating options
rasp-2.png (108 KiB) Viewed 20426 times
but again that makes no difference at all. What is the correct way to make this change?

(2) I would like/need to do certain mathematica calculations from the command line. I tried to follow the instruction in e.g.

http://openmetric.org/til/programming/r ... -terminal/

but raspberry pi says that "math: command not found". What is the correct command?

(3) Re commandline, I did find

https://www.wolfram.com/wolframscript/

but it seems to take quite a few second each and every time I call this. It is possible e.g. to load wolframscript into the ram once and for all at the start of the session and save myself a bit of time? (I need to call this many times from the commandline)

THANKS!

datagrammarian
Posts: 9
Joined: Tue Sep 29, 2020 12:17 pm

Re: mathematica format + commandline

Thu Oct 01, 2020 5:49 pm

For (3), try turning your practice inside-out. Instead of invoking Mathematica from the command line, call the shell from Mathematica. That way the kernel is always loaded (I believe) and only bash (or whatever) has to load, which (I believe) would be much faster.

Specifically, you would start Mathematica sans its frontend with "wolfram" and continue as follows, for example:

Code: Select all

pi@raspberrypi:~ $ wolfram
Mathematica 12.1.1 Kernel for Linux ARM (32-bit)
Copyright 1988-2020 Wolfram Research, Inc.
In[1]:= Run["! echo $PWD > file.txt"] 
Out[1]= 256
In[2]:= FilePrint["file.txt"] 
/home/pi
In[3]:= Quit[] 
pi@raspberrypi:~ $ 
You can also switch to the bash shell from the kernel terminal window and stay in it interactively for as long as you want:

Code: Select all

pi@raspberrypi:~ $ wolfram
Mathematica 12.1.1 Kernel for Linux ARM (32-bit)
Copyright 1988-2020 Wolfram Research, Inc.
In[1]:= Range[4] * Range[0,3] 
Out[1]= {0, 2, 6, 12}
In[2]:= Run["! bash"] 
pi@raspberrypi:~ $ echo -e "Now your in the bash shell...\nuntil you exit it."
Now your in the bash shell...
until you exit it.
pi@raspberrypi:~ $ echo "You're still in the shell."
You're still in the shell.
pi@raspberrypi:~ $ echo "Now exit the shell."; exit
Now exit the shell.
exit
Out[2]= 256
In[3]:= Range[4] * Range[2,5] 
Out[3]= {2, 6, 12, 20}
In[4]:= Quit[] 
pi@raspberrypi:~ $ 
"Be the bit you wish to set."

2 posts • Page 1 of 1

Return to "Wolfram Language"

AltStyle によって変換されたページ (->オリジナル) /